Тёмный

Pretty Powershell 

Chris Titus Tech
Подписаться 621 тыс.
Просмотров 120 тыс.
50% 1

PowerShell is UGLY and cumbersome by default. This Video fixes that!
Website Guide: christitus.com/pretty-powersh... .
►► Digital Downloads ➜ www.cttstore.com
►► Reddit ➜ / christitustech
►► Titus Tech Talk ➜ / titustechtalk
►► Twitch ➜ / christitustech

Наука

Опубликовано:

 

30 окт 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 253   
@mehdiaghaei6908
@mehdiaghaei6908 Год назад
Hi Chris, Terminal Icons are missing here which make your terminal so beautiful, *Install-Module -Name Terminal-Icons -Repository PSGallery* In the Profile: Import-Module -Name Terminal-Icons
@ChrisTitusTech
@ChrisTitusTech Год назад
What an awesome module! I'll have to make a video about this in the future. Love this addition. Github link for those that want to see the code: github.com/devblackops/Terminal-Icons
@somdobomk
@somdobomk Год назад
I miss this module every time I'm using macos and arch.
@barungh
@barungh Год назад
@@somdobomk use lsd , instead of ls
@lombervid
@lombervid Год назад
Omg, I didn't know about this module. Thanks!!! :D
@somdobomk
@somdobomk Год назад
@@barungh I had been using exa. Guess I overlooked the -icons flag.
@logaandm
@logaandm Год назад
"it's just more intuitive" says the Linux guy about the Linux terminal. There is nothing intuitive about a UNIX terminal, if it were, there wouldn't be so many complaints by new Linux users about having to use the terminal. It is just what you are familiar with. Powershell WAS developed by Microsoft. It is now open source. Take that for what you will, but Microsoft does not own or maintain PowerShell. That is why there is a PowerShell for Linux and MacOS. Microsoft's supplied PowerShell is based on version 5 to maintain backwards compatibility with IT admins. The latest Open Source Powershell is version 7 - it is not Microsoft. I agree PowerShell has more complex commands, but PowerShell is based on an object oriented paradigm. Basically the old UNIX shell idea of "piping" on steroids and updated to the 21st century. Like almost all OOP, it is overkill for most people or even most programming and scripting tasks. PS was developed to overcome limitations of CMD and the UNIX shell in system administration - that is why it is more complex and has stricter rules. You don't really see any reason to switch from BASH to PS. I don't really see much reason to switch from CMD to PS. Right up till PS does something BASH or CMD cannot.
@CMDRSweeper
@CMDRSweeper Год назад
The Linux terminal is way more intuitive when it comes to system management if you look into the server space vs what Windows is offering, this is where terminal is king these days, as even on Windows server, the default install is just a command line Window with no GUI, you have to actively specify you want that now. Now with the default Windows you have to type a long ass command with dsadd user specifying the domain, name etc to create a user. If you run Samba4 for Active Directory to get as close to it, you can add all of that if you please, but the command would be samba-tool add user (username) "Options if you want" Or you can hit enter after username if you are unsure of the parameters and do it interactively step by step. At least to me, once you have to think in CLI terms, the Linux way is more intuitive and logically oriented than the Microsoft way, and I am not surprised it has evolved to become this way, as CLI based servers and users are far bigger under Linux than Windows.
@logaandm
@logaandm Год назад
@@CMDRSweeper sudo ls -la -R / | grep "intuitive terminal" > null makes no sense to most people. System administration, networking are even more complex. Something that takes 6-12 months training is, by definition, not intuitive. Linux vs Windows administration and shells? I am not surprised a Linux system administrator of Linux servers would find a Linux Shell more useful. Windows administration, is more about managing software distribution on a large number and variety of desktops. Maybe, just maybe, it requires a different set of shell tools?
@RobertSmith-dq5iu
@RobertSmith-dq5iu Год назад
I came here to say the exact same thing. There is absolutely nothing intuitive about nix terminals and I've been a sysadmin for both. I honestly thought he was being sarcastic and was shocked when I realized he was serious.
@CMDRSweeper
@CMDRSweeper Год назад
@@logaandm Although I would be first to say that command doesn't make a lot of sense, but yes, rather than obscure strange switches with /X in various modes, I would say it is. I started out with Windows and hated the CLI, even though my origins are from dealing with DOS, Linux did take a bit of getting used to the various tools, but the piping lets you easily string tools to achieve results. But yes, there is a reason Windows servers have been in a decline and are now living in the SMB segment and desktop management only, anywhere else the Linux boxes have taken over.
@JonLondrezos
@JonLondrezos Год назад
Chris, I honestly don't share your gripes on PowerShell. I love the consistency of the command conventions and usage, the power and cohesion you get by piping outputs, and the ability to use DLL functionality without a performance penalty. So for me it is my goto environment for OS automation. And yes, if you want to play with CLI, then you can alias the hell out of it to whatever you want. For my setup I used aliases to make it work like a RHEL. So if you are comfortable with CLI then you should be comfortable with aliasing your CLI without cluttering keywords. So again, I can't see a reason not to love it.
@alanelston2330
@alanelston2330 Год назад
My Computer programing experience was limited to some very simple command lines and a passable home user knowledge of MS Office VBA, mostly in MS Excel. I got interested in PowerShell partly from seeing what Chris was doing with it in his win10script. I found it very easy to pick up, possibly because I was familiar with the .Net Object Oriented Programing ideas in VBA. I found it a little bit convoluted, but not too bad, especially when I stopped using the shortened command versions initially, (those are what are usually referred to as Aliases in PowerShell. That’s a similar idea to what Chris is talking about, but only a single thing rather than lots of things shortened. The things Chris is talking about would normally be referred to as functions or custom commands (custom CmdLets) when learning PowerShell. There is a lot of useful stuff in this video, but he is also confusing the things himself a bit, IMO, Lol.)
@JonLondrezos
@JonLondrezos Год назад
@@alanelston2330 I don't disagree. My point really is that I still don't get why Chris thinks less of PS. I remember the time when I had to learn csh/bash.... it was (and still is) a horrible experience, full of inconsistencies and prayers that things would work. I will take PS with its advanced object model any day.
@alanelston2330
@alanelston2330 Год назад
I am also not quite sure why Chris thinks Microsoft should be doing this for us. Perhaps I missed the point, but I thought this is effectively making some shortened command lines. Shorthand, abbreviations, and general customising to suit the individual. I don’t think Microsoft can be expected to read everybody’s minds and present them with customised PowerShell environment that suits them. MS have given us the ability to customise to suit the individual if he/she chooses to. That’s good of them isn’t it? Maybe Chris means they should make the default customisations to suit him, because he knows best. Well, maybe, - we will see how everything develops in the future, Lol. :-)
@davidkovarik483
@davidkovarik483 Год назад
Couldn't agree with you more!
@TheGraemi
@TheGraemi Год назад
@@JonLondrezos I completely agree with you. The discoverability from posh is really good.
@ericr5481
@ericr5481 Год назад
Which is more intuitive? Test-Connection -ComputerName stationA -Count 1 -TimeToLive 30 or ping -c 1 -t 30 stationA Seems like the Test-Connection command is more intuitive and easier to remember. Top is PowerShell and bottom is POSIX. If by a mess you mean consistent and well-structured then I agree. Microsoft makes their command output object oriented, which is waaaaay nicer to work with too.
@henryvaneyk3769
@henryvaneyk3769 Год назад
Who has time to type all those characters?
@theritchie2173
@theritchie2173 Год назад
@@henryvaneyk3769 People with more than 2 fingers? People who heard of autocomplete?
@TofuBug24
@TofuBug24 Год назад
I feel like you're completely missing the point of PowerShell. What you call ugly those of us that build and maintain modules and scripts call beautiful in its consistency. Aliases are an amazing idea its why someone like you that just wants to use PowerShell as a glorified bash shell can do just that ( same for windows cmd users) it's an easy on ramp into PowerShell However when you get into actually writing scripts and modules Aliases are AWFUL. The power in PowerShell comes from the agnostic nature of the verb-noun pattern and the consistency that offers. I can hand off code to someone else and they universally understand that for instance Get-ChildItem gets the children of the current location be that files, registry keys, certificates, or even if utilizing a custom PowerShell provider written to use the same Get-ChildItem cmdlet to navigate wiki pages backed with a REST API. Yes it's a learning curve to move beyond treating it like just another shell but the benefits especially the collaborative benefits make it worth the time. Plus you add in the concepts of splatting and you can have clean elegant functions that not only keep things readable and easily updatable, but can be universally understand by anyone windows, mac, or linux that understands PowerShell. Your reliance on aliasing isolates you from a huge part of the PowerShell Community and I personally think that's a mistake.
@Photonarmy
@Photonarmy Год назад
He's got Powershell Newbitis. He is limited to thinking of a shell as an interface, so the bigger picture of powershell is difficult to process. But I get it. On the flip side, my nephew asked if he should learn powershell or python. He heard powershell was cool, but he didn't understand what you're supposed to do with it from the tutorials he watched. He doesn't work as an admin or anything, so I said python. He sees powershell as a programming language, so the bigger picture is again, difficult to process. The power of powershell is that you can make advanced tools without advanced programming. It's a shell but not an interface... and it's an abstraction of the .NET framework, not a script engine. So yes, it is frustrating when people post videos clearly missing the point... but it is what it is. :)
@alanelston2330
@alanelston2330 Год назад
Possibly Chris was the one that had taken some Drugs and at the start was a bit over excited , and over emphasising with the entertainment presentation effect of his video. To some extent he is just perhaps getting good at handling RU-vid as you have to be successful in it, - sniffing something just before you start a video can possibly help. Smarter people can be annoyed I think when he often says wrong contradictory things, but for a layman like me, if you don’t take all he says too seriously, you can learn a lot from his videos, at least I do and can. I had to watch the video a few times before I caught the very last bit: Check out the video right at the end - he had calmed down a bit and said words to the effect that PowerShell was great once you are used to it and for a windows user it is worth the effort to learn. In a few weeks he probably will have forgotten what he said at the start when he was high on the drugs or alcohol, or whatever he takes to get started. I expect he will do a video soon entitled Powerful PowerShell.
@alanelston2330
@alanelston2330 Год назад
This video is at the intermediate level perhaps. A professional scripter that knows PowerShell very well will be a bit annoyed by his mixed up, wrong, seemingly short sighted comments at the start. A newbie will probably get mixed up with, _ the Aliases Chris is talking about, (which could be described as "globaly available", personalised, or user defined functions), , and _ the shortened Command/ Cmdlet abbreviations that are referred to as Aliases. These latter abbreviation type Aliases you often learn about at the start of Tutorials on PowerShell. Often you are advised to avoid them initially when learning. Like any short-cut abbreviation thing in coding, it is often advisable to avoid them initially when learning. Best to get into bad habits later, Lol, once you know what you are doing. For someone in the middle, like me, who learnt some basic PowerShell recently, the video is OK. It seemed obvious to me that he was talking rubbish at the start, but the basic content of the video I found useful and interesting. He explains some things well and in detail, - just IMO.
@TofuBug24
@TofuBug24 Год назад
@@alanelston2330 To be clear my comments aren't meant to diminish his contributions to the conversation of PowerShell. Heck he's technically correct 98% of what he says. He's inadvertently proven that PowerShell is so flexible and powerful that it can be utilized and molded to your whim regardless of your knowledge of PowerShell. I've always been interested in how this language manages to create a world where you could spend your whole life sailing on its vast surfaces being genuinely productive and having a blast and I could plumb the darkest mountains and valleys in its deepest depths with similar productivity and personal satisfaction. The fact that its the same language doing both is just amazing to me. Now the 2% that's just ignorance plain and simple and I can't fault someone for what they don't know. For instance as you pointed out "Talks about aliases" ... "shows poorly formatted functions" that seems like a silly thing to nitpick about but a lot of my career has been teaching my coworkers PowerShell. In some cases its getting our help desk techs to his level comfortable in the shell to do user account tasks quicker. In other cases its taking people from semi competent function writing to polished pester tested module creation. But in all those cases I spent more time dispelling misconceptions they had gotten from other sources than actually teaching them new stuff. One guy we actually walked through the exercise of writing our OWN Where-Object advanced function to show him the inner workings of a command he viewed as god tier complexity to visually drive home how utterly simplistic the inner working actually was. 236 lines in case your interested but ignoring the extensive param block to match the native Where-Object's parameter sets. 3, THREE lines of code the longest being 100 characters! That's it to create the same functionality as the native command. The point is spouting ignorance especially in an overly animated way that attracts equally ignorant people causes real harm to at least someones growth and development. And frankly there's hardly an excuse when he could have spent 5 minutes on the literal Microsoft page Using Aliases and realized what he thought are Aliases isn't what PowerShell defined Aliases as. I'd have a completely different take on this if he'd come on and said "hey for shell people like me it can be daunting to understand PowerShell and I'm sure lots of you are in that boat. So let me show you how I've learned to wrap these commands in my own functions to recreate the old linux commands we're used to. We'll also show how they can all be loaded automatically and finally if you stick around We'll wrap it up with how you can write your own simple function." Instead he made assumptions, never checked his assumptions, just like his code looks like it was copy pasted from someone else who barely understood it when they wrote it. Which brings me to my biggest pet peeve, if you don't understand something don't present yourself as an source of knowledge. I'm absolutely not saying don't speak on the things you know, or to not query about the things you don't. I've had one concrete rule for the teams if worked with over the years. It's perfectly fine to copy someone's work even from the internet but you had better be sure you fundamentally understand how it works before you even think about using that code in production! Bottom line, you're going to take the time to put out a video take the time to make it as accurate as possible and try to check your feelings and bias before you record.
@alanelston2330
@alanelston2330 Год назад
@@TofuBug24 Nice reply, Thx (BTW you seem to be one of the lucky ones at RU-vid. I can’t post more than a few lines. A few people like me cannot easily post a lot. I have to split the comment up. So that was 1 of 10 I rest my case - I had to make several attempts at this post 1……
@rolling_marbles
@rolling_marbles Год назад
Aliases are great, but i’m an advocate of not abstracting the interface into another but rather use each one natively. i do use Bash and Powershell, even use Powershell launched from Bash. I also love the pneumonics of Powershell being Verb-Noun. it’s more natural way of thinking.
@wydx120
@wydx120 10 месяцев назад
Heads up, it's mnemonics, not pneumonics. It has nothing to do with breathing, but rather with memory. English phonetics of Latin/Greek prefixes are a bitch
@danishdude6750
@danishdude6750 Год назад
Linux commands intuitive and smart? Good Lord 🤣🤣🤣
@alanelston2330
@alanelston2330 Год назад
If you are new to PowerShell you may be slightly confused with the use of the word Alias in this video. Usually when you learn PowerShell you will come across Aliases as meaning the pre available shortened versions of commands and CmdLets. The things Chris is talking about would normally be referred to as functions or custom commands (Custom CmdLets) when learning PowerShell. But it’s all down to the same basic thing in the end: Having available a short cut or abbreviation. Often it’s suggested when learning PowerShell to avoid using the (pre available) Aliases. If you do that you may not find PowerShell so convolute and may be not need to use your own (custom) Aliases. There is a lot of useful stuff in this video, IMO. But you may be advised to avoid it if you are just starting to learn PowerShell, or otherwise you might get in a real muddle with your Aliases and Aliases, Lol. :)
@cantis
@cantis Год назад
I'm a little baffled by this one, PowerShell isn't bash, making it into bash is? Why not really use the updated Windows Terminal it's far superior and the customization you're doing is supported there as well. Trying to create sudo on windows? Just open an Admin Terminal if you've pinned it then it's a keyboard shortcut to open as admin. Want to edit a file? vsCode not vim, want to install software then use winget at an admin PowerShell prompt, want a new folder ni -I d want a new file ni (ni is a stock alias for new-item) want to edit that file then code . Don't try and make PowerShell into bash - it isn't.
@fredrikkacsmarck8971
@fredrikkacsmarck8971 Год назад
I don't think they forgot about the path but rather the switch from the PS 5.1 and earlier (win-only) and the core/cross platform version. Backward compatibility and all that.
@alanelston2330
@alanelston2330 Год назад
Yeh, There may be some reasoning to the different profile path place thing. (BTW I think he got it the wrong way around). - It is not just different versions. PS5 is part of the traditional stuff shipped with windows, and sometimes referred to as Windows PowerShell PS7 is a separate install from the built-in PowerShell. PS7 runs side by side with the built-in version. But PS7 is the new, cross-platform, open-source version. So it’s not quite just different versions of the same thing.
@Dem0n1337
@Dem0n1337 Год назад
Hey Chris, Just wanted to talk on the powershell 5 and powershell 7 differences. Microsoft specifically made powershell 5 and 7 different because older versions of windows cannot accept 7. But more than that there are commands in 5 and not in 7 that are needed in older versions of windows. So 7 is its own stand alone thing.
@alanelston2330
@alanelston2330 Год назад
Yeh, they are not quite the same thing, ( and so there may be some reasoning to the different profile path place thing where they are, which I think he got the wrong way around) PS5 is part of the traditional stuff shipped with windows, and sometimes referred to as Windows PowerShell PS7 is a separate install from the built-in PowerShell. PS7 runs side by side with the built-in version. But PS7 is the new, cross-platform, open-source version. So it’s not quite just different versions of the same thing.
@thainguyen4530
@thainguyen4530 Год назад
@@alanelston2330 Similar with me 7 in ~/ProgrammFiles/PowerShell 5 in ~/ProgrammFiles/WindowsPowerShell Chris got it wrong way round
@HumanShield117
@HumanShield117 Год назад
The "touch" command doesn't actually do what you say. Well, it does as a side-effect of what it actually does. When you "touch" a file, you actually update it's most-recent-edit timestamp. It also creates the file if it's not already there.
@metamaverick
@metamaverick Год назад
The more notable flaw to his touch command is that it clobbers/erases an existing file's contents! This is definitely not what you would expect from touch. The fix for this is of course to supply the -Append and -NoNewLine options to his function. You could also use the -NoClobber option but this will emit an error if the file exists which is kind of ugly for day-to-day use. Hopefully Chris will see this and fix it ASAP. This is more in line with what one would expect for the default behavior of touch (no other options other than the file specified): function touch([string]$file) { "" | Out-File $file -Append -NoNewline $d = Get-Date $f = Get-Item $file $f.LastWriteTime = $d $f.LastAccessTime = $d }
@alanelston2330
@alanelston2330 Год назад
I think perhaps what Chris is doing here might be along similar lines to what you can do in VBA to make Sub routines (other short available codings/ programs) generally available in your coding. In Excel VBA, for example, you put these Sub routines in a Personal macro workbook, then they will generally be available to Call from other Workbooks I am not sure yet exactly how similar it is, whether for example more than one command line into what he is referring to as his Aliases. It is interesting, he has sparked my interest to try out these things.
@alanelston2330
@alanelston2330 Год назад
Chris, there may be some partial reasoning to the different profile path place thing. (BTW I think you got it the wrong way around). - It is not just different versions. PS5 is part of the traditional stuff shipped with windows, and sometimes referred to as Windows PowerShell PS7 is a separate install from the built-in PowerShell. PS7 runs side by side with the built-in version. But PS7 is the new, cross-platform, open-source version. So it’s not quite just different versions of the same thing. Alan
@alanelston2330
@alanelston2330 Год назад
I also thought that PS5 was the default shipped on both windows 10 and windows 11. I thought you might need to download PS7. I could be wrong or it might have changed. You can easily check what you have or are currently using by typing a variable command thing in the PowerShell window. If I try to give you that, the RU-vid Comment Police Bot deletes the comment. So I try it a bit differently. So it starts with a dollar sign, then these words all joined together without any spaces PS Version Table
@diabilliq
@diabilliq Год назад
@@alanelston2330 PS5 is stock with 10, 7 and the windows terminal is on 11...forget which build though. the big difference between PS versions that is likely the reason for different profile is that PS7 is built on .NET Core, a big difference vs 5 and hence there are a bunch of modules that aren't compatible in 7 that work in 5 and probably vice versa.
@alanelston2330
@alanelston2330 Год назад
@@diabilliq Thx for the info, Bill I have a few win 7 and win 10 machines and just one win 11. What you say seems to tie up with what I have seen so far. All (including the win 11 machine) seem to have PS5 (Windows PowerShell) as shipped. To get PS7 I have to download it. PS7 generally seems to be referred to as PowerShell or pwsh and gets put at C ProgrammFiles PowerShell PS5 is to be found in C ProgrammFiles WindowsPowerShell (So it’s approximately the opposite of what Chris said in the video) By default, by opening powershell I get PS5 in a blue window. If I have PS7 installed, I can get PS7 by typing pwsh in that blue window, (and it stays blue). If I either double click on the pwsh exe file, or type pwsh from the command prompt run thing, then I get PS7 in a black window.
@alanelston2330
@alanelston2330 Год назад
I have never tried the windows terminal that is new since windows 11. (I am just a computer Layman, but some computer professionals have commented to me that they think both PS5 (windows power shell) and the new terminal will fade out and the open source PS7 + will become the most common. But that is just their opinion. I can’t comment as I have just experience mostly with the simple command prompt, and PS5, a bit of PS7, and no windows terminal experience Chris seemed to like windows terminal a lot when he first stasrted using windows 11, but he changes his mind a lot, Lol)
@alanelston2330
@alanelston2330 Год назад
@@diabilliq I was a bit surprised that you mentioned the Net stuff as a difference between PS5 and PS7, because: I thought I picked up from Tutorials that the Net and Object Orientated Program stuff was the big difference between _ power shell generally (PS5 PS7 and earlier PS versions) and _ the earlier simple black command, cmd, window stuff, (the simple command stuff which works like the very early non windows computers) I may have misunderstood what you meant
@chaminda512
@chaminda512 Год назад
When someone learned to use PowerShell to some extent, even if they love bash they will eventually understand that PowerShell is much more powerful and consistent you could do so much more with it compared to bash People who use PowerShell know those verbose outputs and commands make much more sense Also if you get familiar with aliases for day-to-day use it can be quick
@alexstone691
@alexstone691 Год назад
I did not like powershell before, bash is simple (until you get into very advanced things) and used to like that now i started learning powershell and im loving how consistent and how quickly i got a working script while i would have several bugs along the way in bash Havent even got to using C# or dll stuff which sounds amazing, wonder if you can do that on linux too with shared libraries
@galaxyguy9873
@galaxyguy9873 Год назад
This. I have decided to switched to pwsh as my default shell on my linux machine, for at least a few weeks, and am loving it so far.
@alexstone691
@alexstone691 Год назад
After a while only thing that kinda made me hate pwsh is how they cant follow their own pattern, like with WhatIf that is followed by some commands but not all While pwsh is really powerful im again using bash but i learned its features better like {var:?} which errors out if the var is not set or is empty which will prevent this nightmare 'rm -rf /${var}'
@macethorns1168
@macethorns1168 Год назад
If by "more powerful" you mean "more convoluted and complex" then yes, I agree.
@ThePowerRanger
@ThePowerRanger Год назад
Powershell commands are good though, they follow a consistent naming scheme and tell exactly what they are going to do and the official documentation is also really great. I would say Powershell is better than bash. I say most people like bash is because they are familiar with it. I mean how does "touch" mean create a file whereas "new-item", now that makes more sense.
@bitocouillu
@bitocouillu Год назад
Yeah I have noticed with people who are new to IT that they will become autonomous with Powershell far quicker than with bash. With powershell once they understand the object oriented and get-command, get-help and get-member they are good to go. With bash it's harder
@hellohigoodbye
@hellohigoodbye Год назад
Absolutely agree with you.
@ceremus
@ceremus Год назад
100%. The Verb-Noun format may seem long winded at first, but it's immediately intuitive, and tab-completion is ubiquitous for every command and their possible parameters. So it's not only easy to understand, but object-oriented input-output make it extremely powerful and versatile. You can string together as many commands in a pipeline as you like and never have to worry about formatting the input or output as long as you look up the I/O type of the commands you're using. Or build your own commands and modules with their own independent functions, and have them work together like Lego.
@ArniesTech
@ArniesTech Год назад
True, Mr. Power Shell Ranger 😁
@RedBearAK
@RedBearAK Год назад
The main purpose of the “touch” command is not to create a new file but to update the time a file was last “touched”. So the name is perfectly logical. There must be a similar command in Powershell.
@Lanzetsu
@Lanzetsu Год назад
Thanks! I've been expecting this since the last week when you announced it
@SamSamTutorialMan
@SamSamTutorialMan Год назад
"wget" already IS an alias in powershell for Invoke-WebRequest! I get what you're trying to say but that was literally the worst example you could come up with. lol
@azuroth8609
@azuroth8609 Год назад
Just a heads up - 'uptime' does not work correctly in Pwsh 7. the ConvertToDateTime step just returns a blank
@elatedbento
@elatedbento 9 месяцев назад
Same here. I also get a blank with Pwsh 7.
@TheOne299
@TheOne299 Год назад
For some reason after following your instructions, my prompt doesn't look like yours. I have the colors, but not all the parts of the prompt are displayed. I get strange characters. (look like small boxed question marks) Did i do anything wrong?? (I did install the Cove Nerd fonts)
@DarrylWright
@DarrylWright Месяц назад
This is super-helpful but one of the things I noticed is that when you make changes your profile .ps1 file, it automatically replaces itself when you reload it (deleting your changes). Is there a way you can add your own functions?
@yoxinator
@yoxinator Год назад
After setting up PowerShell with Windows terminal, terminal icons, psreadline tweaks, ohmyposh, and scoop, it's better than bash. Fight me. The first thing I do on my Linux machine now is install PowerShell. This way I can use PowerShell commands and bash commands :)
@handsomejack1018
@handsomejack1018 Год назад
PowerShell is the way it is because it uses C# on the backend and I use methods that are a part of C# in my scripts and modules. Good project but your bias is showing, I am new to BASH and it isn't hard for me to remember that touch is similar to New-ChildItem.
@UltramarinePrimaris
@UltramarinePrimaris Год назад
This was a nice birthday present. Thanks, Chris !
@comesignotus9888
@comesignotus9888 Год назад
Have you tried gsudo (winget install gsudo)? It elevates the current prompt in quite a Linux-like way, instead of opening a new one, might be a good replacement for your "admin" script.
@arthurpizza
@arthurpizza Год назад
"Not going to be a Microsoft Bash session" No, it's a powershell session.
@dus10dnd
@dus10dnd Год назад
Heh? PowerShell looks great and distinctive, on purpose and for value. the Verb-Noun pattern is fantastic because when you search on it... you will find results relevant to PowerShell, not something for Bash or otherwise. You're mostly just searching for criticisms that all have logical explanations. Also, I am a Linux guy... PowerShell is better than Bash, qualitatively. The difference in environment variables is because they literally switched from Windows PowerShell to the open-source and cross-platform PowerShell; they work side-by-side.
@alanelston2330
@alanelston2330 Год назад
Chris was a bit over excited and mixed up at the start I think, and over emphasising with the entertainment presentation effect of his video. (Perhaps he had taken something and he was the one on drugs, Lol, :-) ) Right at the end he calmed down a bit and said words to the effect that PowerShell was great once you are used to it and for a windows user it is worth the effort to learn. In a few weeks he probably will have forgotten his criticisms and will do a video entitled powerful PowerShell. To some extent he is just perhaps getting good at handling RU-vid as you have to be successful in it. If you don’t take all he says too seriously, you can learn a lot from his videos, at least I do and can.
@ashujain6479
@ashujain6479 Год назад
Please make a video on "is kms safe to active window and ms office"
@mrgeebee1622
@mrgeebee1622 5 месяцев назад
Could you make or update this for PS 7?
@Elvgr
@Elvgr Год назад
Hello, what software do you use for a explorer context menu like this? Thank you
@Elvgr
@Elvgr Год назад
@Unfounded Yes, thank you, I found it
@echobucket
@echobucket Год назад
If you have scoop, I do scoop install coreutils then I remove a bunch of the default powershell aliases and I have the GNU coreutils like I have in Linux
@TheGraemi
@TheGraemi Год назад
I am not a M$ fanboy (there's a reason for my alias😉), but man I disagree that BASH is in generell better.
@somdobomk
@somdobomk Год назад
Been using starship with terminal-icons module for wsl arch, powershell, and macos but oh-my-posh looks pretty cool. Gonna have to try it out.
@afeef2152
@afeef2152 Год назад
Awesome! I love eyecandy for terminal too
@drescherjm
@drescherjm Год назад
As a c++ programmer I still use a cmd.exe window as I have for around 30 years since I have had windows. These days its in a windows terminal and I typically have 4 to 6 tabs open at all times.
@davewiebe2582
@davewiebe2582 Год назад
Why not use the ISE?
@ezclap3301
@ezclap3301 Год назад
Hi Chris, Can you share the tweaks used for a explorer context menu, looks clean and functional.
@ezclap3301
@ezclap3301 Год назад
@Unfounded thanks for the info.
@justinemmons2369
@justinemmons2369 Год назад
More PowerShell videos. This was excellent!
@freem4nn129
@freem4nn129 Год назад
When the font is acting strange don't forget to change the font in powershell to the cascyvadia cove font. my powershell looks sweet right now ^^ thx chris
@irishbruse
@irishbruse Год назад
Why do you still show the splash screen
@thewalrusdragon9579
@thewalrusdragon9579 Месяц назад
My PowerShell profile.ps1 is completely empty. Is that normal?
@Geezr
@Geezr Месяц назад
Yes, you need to add what you want to auto load when you start powershell. You get to configure and load your preferences vs learning someone else's.
@carstenschlegel6975
@carstenschlegel6975 24 дня назад
You can use ii (Invoke-Item) to start any type of objects. Directory was open in explorer, Files was open in the App and so on. ii . Open current directory in explorer. It works on Windows, Linux, Mac. (on Linux & Mac PowerShell Core you can also use all Linux commands like fzf, tmux, grep, ...)
@bobbybologna3029
@bobbybologna3029 Год назад
Okay I busted up laughing, I had no idea that Powershell could be "bedazzled" I might just do this to show off to some buddies and get made fun of 😂. Suggestion for some videos, I learned some bash through you from your old videos (where you were next to a kitchen!) have you thought about doing some videos on basics of Powershell and DOS? In Linux I can get around like nobody's business but when I land in Windows I am definitely a fish-out-of-water, I just like your delivery over others, you take a very realistic approach to everything. Maybe do it as a sort of "How to kit out a Windows system for a Linux nerd" or something 😁
@ArniesTech
@ArniesTech Год назад
Bamboozled 😁😅
@Sora185
@Sora185 Год назад
How did you make your context menu so pretty? Didn't notice that in your videos till now.
@Sora185
@Sora185 Год назад
@Unfounded Awesome! Thank you :)
@ControversialOG
@ControversialOG Год назад
I had been using ohmyposh since last six months, it makes terminal look cool but it has its own flaws.
@alanelston2330
@alanelston2330 Год назад
Chris mentions towards the end of the video the usefulness of using the (PowerShell) Command level Interface (CLI) in tandem to the Windows GUI interface when learning PowerShell. Along similar lines, when learning and developing PowerShell script, I would recommend using the ISE (preferably opened as Administrator). You will find the script development window environment thing of the ISE particularly familiar if you are familiar with other similar development environments such as the VB Editor in MS Office VBA. When you open that for the first time, check the view tab options so that you can see both the code type script window and the blue PowerShell window. You can run a script that you write (or paste into the script window) immediately by hitting F5 or the play button. Or in parallel you can run a command from the PowerShell window. An interesting learning exercise, for example, is to 1) write that function dirs thing that Chris explains at minute 3 into the ISE script window, (or copy it from Chris’s powershell-profile ps1 file over at G Hub, then paste it in) 2) run it 3) now you can write dirs in the ISE PowerShell window, and it will work! I always run Chris’s win10script and winutil script this way, as then I can do simple mods to the script, and immediately try them out. Great learning experience.
@metamaverick
@metamaverick Год назад
If I am not mistaken ISE is not for PowerShell Core though (which is what is likely recommended for anyone getting started unless they need to tend to legacy stuff). For Core you should use the PowerShell extension in VSCode.
@alanelston2330
@alanelston2330 Год назад
@@metamaverick Ahh, OK, good points, Thx. I have no experience with Visual Studio. Judging by the comments coming in the whole story of PS7 and or PS5 would appear to have been missed by Chris, as has most of what PowerShell is all about, Lol. Not criticising necessarily, his tangents sometimes reveal interesting things, but clearly this video is missing a lot of important points and issues
@alanelston2330
@alanelston2330 Год назад
I do remember that when following some of Chris’s early PowerShell stuff, I discovered that some things the scripts were claiming to do, they couldn’t because the script code to do it was only available in PS7, not PS5. (Back then, he was using the built in shipped with windows PowerShell, so PS5, most of the time.) Half the time the code lines were not even in the script anyway, they got lost or never put in due to the endless chaos over at G Hub where he loses control of his scripts. A lot of stuff was missing or mixed up, and still is half the time, Lol. But still all interesting and entertaining stuff, IMO.
@macethorns1168
@macethorns1168 Год назад
CLI is command line interface, and use VSCode instead.
@Petoj87
@Petoj87 Год назад
If you like a nice PowerShell terminal give PowerType a try it adds autocomplete for cli tools like npm and docker (it's still a work in progress).
@ElementalCode
@ElementalCode 2 месяца назад
ii . That's double lowercase i and then any file or folder and it will open it with the default program. It's a shorter way to open the current directory than explorer .
@garthor
@garthor 2 месяца назад
FYI: I think according to the docs $profile is different in v5 vs. v7, because they run as two separate programs... stuff in v5 might break v7 and vice versa... so they kept the profiles separate, so you aren't scratching your head asking for version info when you might break something... your old v5 profile will work out of the box, because it only goes to the v5 profile path, likewise with the v7 profile path... Why they didn't just make that obvious by tacking on a version number to the path? Idk... but that's the reasoning.
@christosbinos8467
@christosbinos8467 Месяц назад
Microsoft very much knows about the $PROFILE variable. The reason they are have different paths is so that both powershell 5.0 and 7.0 can run on the same system without compatibility issues.
@krakendeez7415
@krakendeez7415 Год назад
for some reason i get the "The '
@krakendeez7415
@krakendeez7415 Год назад
and then its a whole row of errors when using the script
@metamaverick
@metamaverick Год назад
The answer to your question depends on what operation you expect the < to perform. If it is for comparison of two numbers then, just like bash, you should use -lt. For more info on comparisons, search powershell docs for about_Comparison_Operators.
@krakendeez7415
@krakendeez7415 Год назад
@@metamaverick i meant when i ran the script
@RoryIsNotACabbage
@RoryIsNotACabbage Год назад
Re: alias vim=nvim (Although the code is for zsh so maybe edit for powershell) --- alias vim="$EDITOR" if (( $+commands[nvim] )); then export EDITOR='nvim' elif (( $+commands[pvim] )); then export EDITOR='pvim' elif (( $+commands[vim] )); then export EDITOR='vim' elif (( $+commands[vi] )); then export EDITOR='vi' el --- Lets you load the one config anywhere and get whatever flavour of vim you have, in order of preference
@ChrisTitusTech
@ChrisTitusTech Год назад
dig it, i'll commit that to the profile.
@ChrisTitusTech
@ChrisTitusTech Год назад
Worked on this a bit. Ended up with this code for Powershell Profile based on your Pseudocode - Thanks for putting the idea out there. Function Test-CommandExists { Param ($command) $oldPreference = $ErrorActionPreference $ErrorActionPreference = 'SilentlyContinue' try {if(Get-Command $command){RETURN $true}} Catch {Write-Host "$command does not exist"; RETURN $false} Finally {$ErrorActionPreference=$oldPreference} } # # Aliases # if (Test-CommandExists nvim) { $EDITOR='nvim' } elseif (Test-CommandExists pvim) { $EDITOR='pvim' } elseif (Test-CommandExists vim) { $EDITOR='vim' } elseif (Test-CommandExists vi) { $EDITOR='vi' } Set-Alias -Name vim -Value $EDITOR
@PH0T0N
@PH0T0N Год назад
is there any way to reset my powershell to default?
@Z.Matyas
@Z.Matyas Год назад
That's my question too. I got stuck at the beginning and that's why I would like to reset it. Certain characters have also disappeared in the Terminal, they are replaced by squares.
@TheGraemi
@TheGraemi Год назад
Add to it to have a good look at PSReadline. Already installed on W11 (but update) and a must install on W10.
@UraharaKira
@UraharaKira Год назад
Have you tried nushell?
@amateurwizard
@amateurwizard Год назад
Hey Chris do you know a Jalopy Jones? 🤔
@donaldmickunas8552
@donaldmickunas8552 Год назад
Hey Chris, NICE!!!! I love aliases. I actually considered learning Powershell a few years ago. When I saw what a wordy convoluted mess it was, I scraped the idea. I don’t use Windows anyway. It was one of my hair brained ideas. I imagine those aliases could be expanded quite a bit. Bash on Windows by way of Powershell!!!!! LOL
@DominicVictoria
@DominicVictoria Год назад
If you have wsl2, just type bash on powershell. You’re welcome. 😊
@donaldmickunas8552
@donaldmickunas8552 Год назад
@@DominicVictoria True though since I don’t use windows, your comment doesn’t apply to me.
@sunnyheheheh9401
@sunnyheheheh9401 Год назад
thanks for the video it made the exp better it is really a pain when I start using pwsh after using bash (i have dual boot) , btw how can i make cd go to the home directory( can't write ~ , writing tilde ~ hurts my fingers) the cd command doesn't work in the old powershell 4 and it just hurts so much i don't want to use PowerShell 7 it is cross platform and slow AF (it just sucks) , pls help
@bitocouillu
@bitocouillu Год назад
set-location $HOME
@markusTegelane
@markusTegelane Год назад
Yeah, that Verb-Noun structure of commands is something I never Get-UsedTo
@TheGraemi
@TheGraemi Год назад
together with PSReadline it makes for better discoverability/usability.
@SirMoefe
@SirMoefe Год назад
To reload your profile in PowerShell, you can type ". $PROFILE". It's like the source command in bash etc.
@BruceLee-qc2lm
@BruceLee-qc2lm 9 месяцев назад
Wish the customization was better UI. I want background to be black, but then some of the brackets and other commands are black by default. So you have to dig through each one and change it from black. Very annoying if you want a dark theme.
@AhmedSamyeg
@AhmedSamyeg Год назад
I use oh-posh on windows Mac and Linux with my owns custom profile it’s amazing
@eyssewieringa2084
@eyssewieringa2084 Год назад
Why not the windows terminal with linux intergration?
@ChrisTitusTech
@ChrisTitusTech Год назад
WSL is bulky and i'd rather have native performance. That and it has issues reading NTFS with any type of speed. For my usage WSL is just slow AF and I'd rather use pure Linux for my purposes.
@eyssewieringa2084
@eyssewieringa2084 Год назад
@@ChrisTitusTech ahh okay. Understandable!
@therealslimaddy
@therealslimaddy Год назад
I just use nushell in windows which has commands like ls, rm, mv etc
@shutterassault1
@shutterassault1 Год назад
Not a huge powershell user, but a lot of the new commands seem to only work in Powershell 5? Not the newest 7. For example, Get-WmiObject isn't recognized in 7. MS definitely confused Powershell for me with all the different install directories and versions.
@bitocouillu
@bitocouillu Год назад
It's probably because get-WmiObjet is deprecated, use Get-CimInstance instead
@shutterassault1
@shutterassault1 Год назад
@@bitocouillu Thanks for this..
@alanelston2330
@alanelston2330 Год назад
Yeh, they are not quite the same things. PS5 is part of the traditional stuff shipped with windows, and sometimes referred to as Windows PowerShell PS7 is a separate install from the built-in PowerShell. PS7 runs side by side with the built-in version. But PS7 is the new, cross-platform, open-source version. So it’s not quite just different versions of the same thing.
@kanemetal
@kanemetal Год назад
man where are your single letter variables and short-hand flag names? I thought it was too much trouble to Verb-Noun -fullFlagName
@skatterbrainz
@skatterbrainz Год назад
"'was the standard for Windows 10"... lol! PowerShell 5.1 is still the default on Windows 11
@RafaelLorenteSalgueiro
@RafaelLorenteSalgueiro Год назад
Hi Chris nice video like always After install Oh-my-posh you can use as admin "oh-my-posh font install" to install nerd-fonts, you can add 2 PS modules for a better look and feel "Install-Module -Name Terminal-Icons -Repository PSGallery" for icons when you use ls or ll or dir. "Install-Module -Name z -RequiredVersion 1.1.9" just like autojump you use with linux anter use "cd folder" one time you must configure fonts in windows terminal Defaults>Appearance FontFace
@beardo-baggins
@beardo-baggins Год назад
I hate how cmd prompt opens in, what seems like, a random location on my screen every time I open it in the new version of Win11. I'm currently on 22H2 build 22621.755. I use to have it always open in the bottom left corner of my screen. But, I can't seem to find a way to do this since the last big version update. So, my question to you @Chris Titus Tech or anyone who can help me. Is there a way to get this done, in a way that even a n00b can do?
@longphamthanh3792
@longphamthanh3792 Год назад
I'm using FancyZones from PowerToys. So basically with a predefined layout, every time I launch an app, it will snap to its previous location. You can also overwrite the default Windows+arrow keys to make applications span across grids.
@gl5638
@gl5638 Год назад
OK very nice video! Only thing missing now is you should make a video about installing neofetch on windows.. :D :D
@ChrisTitusTech
@ChrisTitusTech Год назад
Next Monday!
@robinreso6240
@robinreso6240 Год назад
how can i run a batchfile/powershell/bash script on selected items in current working directory in windows?thx
@blevenzon
@blevenzon Год назад
This is so awesome, just sucks if you’re you move to a different win machine back to Microsoft default commands
@mightydrew1970
@mightydrew1970 Год назад
I point my Documents folder up to OneDrive. As long as I point the same way your Documents\PowerShell or Documents\WindowsPowerShell folder is there and your $PROFILE comes with it. It's like magic when you move to a new PC!
Год назад
it's true, i was there, i was the terminal. they were on drugs
@alanelston2330
@alanelston2330 Год назад
Chris was a bit over excited and mixed up at the start of this video I think, perhaps he had taken something and he was the one on drugs, Lol, :-)
@LordHog
@LordHog Год назад
Excellent video
@alx8439
@alx8439 Год назад
Probably it's the time to tell Chris there's such a software exists as cygwin. Who dares?
@revenge977
@revenge977 Год назад
he knows about wsl so he probably knows about cygwin as well, sometimes you just have to use the powershell.
@darkangelo
@darkangelo Год назад
every time i try to install your stuff it freaks out my antivirus lol
@markselvenis7273
@markselvenis7273 Год назад
Copied and ran link, received errors
@markselvenis7273
@markselvenis7273 Год назад
Chris, I able to install from iex on your GitHub page
@utubepunk
@utubepunk Год назад
This video was perfect for the Drakeposting Meme as a thumbnail. Boring PowerShell on the top, upgraded shiny PowerShell on the bottom! 😄
@Sandeep_Kasturi
@Sandeep_Kasturi Год назад
Hi Chris, thanks for this video. Can you do one more video on how to get same terminal with Visual studio code?
@TrueDelta22
@TrueDelta22 Год назад
Getting an error with unzip. Cannot validate argument on parameter 'Path'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. Any idea why?
@floppa9415
@floppa9415 2 месяца назад
0:25 Funny I find the exact opposite to be true. I find PowerShell leagues more intuitive than other shell environments. Starting from the syntax which is much close to a programming language, the consistent naming of stuff and the consistent handling of arguments, ... I much prefer it to shoot myself in the foot with MY aliases
@hughnailedit9885
@hughnailedit9885 Год назад
How do i completely remove this? i tried tampering with it exactly by your tutorial and now PS won't recognize simple commands. even "choco" only works randomly....
@jackelofnar
@jackelofnar Год назад
Having issues with execution policies any ideas?
@RandyWSims
@RandyWSims Год назад
A good bit of that Powershell config could be replaced with tools that are available on both Windows and Linux: ls=exa or lsd, cat=bat, find=fd, grep=ripgrep, du=duf or gdu, ntop & procs for viewing processes. zoxide eliminates the need to shortcut directory hops. gsudo lets you run a elevated command. fzf could be spun in to a multipart series, integrating it with other tools to fuzzy search files (w/ preview), complete commands, etc. It's amazingly versatile. bat is cat on steroids. chezmoi lets you manage all your configurations files, even across OS. scoop install gsudo chezmoi curl wget diffutils exa zoxide broot lf gdu ntop procs duf fd fzf grep gsudo bat less ripgrep sed winfetch lazygit sysinternals Install-Module -Name Terminal-Icons Install-Module -Name PSFzf
@LeonisYT
@LeonisYT Год назад
That's a clever username lol
@larrybenedictomarzanjr.8288
Hi Chris, Great content as usual. Next time can you teach us how to make pxe boot server so we can boot our linux image from network. Thanks
@IBENF
@IBENF Год назад
Man, my mind went back to Dos 3.* days. WP and several other programs fit on a miniscule hd. No telemetry. A simple printer. I wish we could have that back again, obviously without threats to security or privacy. I could live without the Internet. Just an old man's nostalgy or is that actually possible?
@OlafSoyk
@OlafSoyk 4 месяца назад
Depending on where you come from I totally disagree, that the commands used on the terminals in a Mac or on Linux are intuitive and smart. They are as far from intuitive as it gets. On the other hand PowerShell cmdlets have a - most of the time - logical naming convention and a consitent structure. ... just my 2ct. 🤷🏼‍♂
@zvanmilisavljevic8879
@zvanmilisavljevic8879 Год назад
Nice
@Darakon
@Darakon Год назад
Very informative. Thanks!
@yetanotherbloke
@yetanotherbloke Год назад
Hi Chris, mostly I agree with what you're saying - some of the Powershell commands are downright wordy. However, the rationale was that they wanted to be consistent with their naming. Fixing it is exactly what your profile is for. Your profile supports your habits and preferences no matter what OS you're on. Case in point, in bash if I go "cd.." I get an error (DOS habit). So my bash profile gets an alias for it. Now I get to keep my hair.
@shoddits2156
@shoddits2156 Год назад
I use MSYS2, I don't bother with powershell
@garthor
@garthor 2 месяца назад
Wait... you use VIM? you lost me there... you monster!
@TheTheThewillow
@TheTheThewillow 13 дней назад
You know you can use tab with astrics to find shit😅
@arturorochoa9359
@arturorochoa9359 Год назад
Pretty Powershell is just PP. like, Pretty Printer in Haskell
@duyhung.30
@duyhung.30 Год назад
can u make a video about neovim configuration from scratch in windows sir thks alot
@LilHoss
@LilHoss Год назад
I am totally lost, the "One Click Install" throws up a whole screen full of errors. I think you are four layers down into the cake, and I'm still licking the frosting. I can run PS, then i see "I’d recommend running it from an admin elevated prompt for installation of OhMyPosh." never heard of OhMyPosh, so I go and install that and read about it. It seems like I'm trying to solve a puzzle and several pieces are hid under the couch!!!! I think you're assuming your viewers are experts at this stuff....or I'm watching the wrong channel. Is there a "Blues Clues" version of this?....lol
@LilHoss
@LilHoss Год назад
I got the profile to install, couldn't run the One Click Install though, I downloaded it from github and unzipped and did a "run in powershell" on the setup,ps1 file.
@olmrgreen1904
@olmrgreen1904 Год назад
Awesome! Thank you!!
@ZombieLurker
@ZombieLurker 3 месяца назад
Too bad this doesn't work anymore.
@muddyexport5639
@muddyexport5639 Год назад
After viewing, thank you seems like a lame understatement. But, anyway, as it's the best I can do, "Thank You!!"
Далее
The Perfect Windows 11 Install
8:53
Просмотров 985 тыс.
Украшаю чехлы 🎀
00:51
Просмотров 79 тыс.
Windows Utility Improved for 2024
17:56
Просмотров 330 тыс.
Learn PowerShell in Less Than 2 Hours
1:48:21
Просмотров 249 тыс.
Level up the look of your terminal with Oh-My-Posh
10:36
You Should Learn PowerShell
13:18
Просмотров 26 тыс.
Installing Linux The "Right" Way
18:43
Просмотров 646 тыс.
Modern Graphical User Interfaces in Python
11:12
Просмотров 1,5 млн
Beautiful Bash
8:42
Просмотров 176 тыс.
iPhone socket cleaning #Fixit
0:30
Просмотров 14 млн
$1 vs $100,000 Slow Motion Camera!
0:44
Просмотров 25 млн