Комментарии:
pwsh is amazing
ОтветитьOne easier manner to get what you last typed was to click on the Up Arrow or Down arrow button on the Keyboard. You can scroll thru the last commands you typed in.
ОтветитьHi Gary! So glad I watched the whole video! Thank you for the awesome simple content. I need to watch again and make some notes. Thank you for this lesson! 👍🙏
ОтветитьPowerShell is verbose, but have good gears to windows. In windows env I recommend use. But Nix universe is good stay with bash,Zsh , perl or python....
Ответитьihy has an alias of 'r' (without quotes). Makes it even easier
ОтветитьThis is the quality of content that professors around the world should use as a benchmark. If they exceed this, wonderful but at least try to deliver legibility like this.
ОтветитьI just join your channel.. would like to see windows powershell lessons
ОтветитьHow to install Emacs? Can that be done through winget?
ОтветитьGreat ! TA !
Ответитьcan anyone help - i did install as command shows then got usual pop windows of installation and yet later after shutting down and starting over powershell i still got old one. what i am doing wrong? maybe i should simply restart powershell not close it but i do not how....
Help please
When you start passing complex objects down the pipeline and doing extremely complex stuff you come to realize how easy it can be compared to other shells
Essentially, if you are an IT admin you got to know it
Thanks a lot, trying to follow along in the hopes that finally the PS commands keep sticking in my mind. But I have to say, getting the latest PS version with winget from the command line ... and then a window pops up wanting acknowledging - this is such a windows thing to do. And then closing the ps window and starting again - it still shows the old version???
ОтветитьPowerShell tab completion not only completes the command you've started, if give a few letters, it will cycle through every possible command that has those letters. If you pass up the one you want, <Shift><Tab> goes in reverse order.
Tab completion also will give you a list of all possible switches. Type in the command, put in one white space <Spacebar> then the <Hyphe> followed by the <Tab> and it will cycle all the possibilities. In in the old PowerShell ISE or newer ISE, you get a context menu to appear that you can select the switch needed from the list.
I put off PowerShell for the first few years, and only began to use it at the end of v2 with v3 coming out soon after I started learning. I absolutely love PowerShell for what you can get that isn't given (or not given easily) in Windows GUI.
Case in point, the FQDN of a network computer. Get-ADComputer -Identity ComputerName will return five or so lines of the most common information of a computer object from Active Directory, one of which shows the OU path to finding the computer in AD.
There is so much that can be done with simple commands in PowerShell. Once you learn a few, you will see how most can chain together via piping. I stress most, as some do no feed into other commands as one would hope or seem to expect.
Where PowerShell shines is in simple scripting with a ForEach stepping through a list of objects and performing some task. Continuing on from the previous example of Get-ADComputer, you can specify an OU, then feed the results into a Get-Win32 (or newer Get-Cim) and pull things like the serial number stored in the machines BIOS, how much RAM is installed, Hard Drive space total and free to build a CSV that can be imported into Excel to help determine what hardware may be reaching end of life or need upgrading.
The only limit to PowerShell is really our own limit to image what we can do with this tool.
Lol😂😂 power shell is quite powerful compared to cmd
ОтветитьSo the new version of PowerShell is no longer only on Windows it is also on Linux and Mac os.
ОтветитьLovely video.
I used to script using DOS batch many moons ago.
Now fully immersed in PowerShell and love it, 😂
Yes, content like this is nice.
Thank you 🙏
Wow i didn't know 1 day I'll say this but. Powershell look kind of good!
ОтветитьI love PowerShell. I maintain a huge 911 system (larger than some countries) and it helps me stay out of the news.
In my world, you fix things before they even fully break. PowerShell let's me see stuff.
Give powertype a try (I'm the creator)
ОтветитьI posted this below as a response but I’d very much like an answer to the question at the end so I reposted at the top.
Powershell clearly has power. But it’s very specific, very verbose , and I’m never doing anything with out
“SHOW-COMMAND” and “GET-COMMAND | OUT-GRIDVIEW” running in the background along with online documentation. Because you can’t just remember such a verbose language. It’s consistently is nice and occasionally elegant.
Btw “show-command” is blocking. If anyone has a trick to make it non blocking I’d sincerely appreciate it. Because it means I have to open a second terminal just for that, I’ve tried start job and run process and similar, I need the “&” operator equivalent
am i missing something ... when i run the update method as described it all installs fine , but that creates a new powershell in a different directory alongside v 5. can i replace v 5 entirely ?
ОтветитьPowershell is amazingly powerful and occasionally elegant- but like literally everything Microstoft 10x more complicated than necessary- It’s also an incredibly verbose language. It’s a very precise language with minimal feedback. It has elements of sh and a good bit of Perl Syntax.
I’ve spent a few years trying to get good at it and I’ve written several script-lets. It’s powerful for windows but it’s not friendly- beginner or otherwise I decided. I mean some of it is brilliant, but coercing object to the same general stereotype object is both intuitive and occasionally maddeningly absurd, coercing each commondlet to a verb-noun is brilliant but also sometimes absurd.
It is , let’s be honest 1,000,000 times stronger than cmd, and sometimes you just need the cli to get to stuff not in the gui. Wish was an option- which ran vbscript and later JavaScript and now both. There’s batch scripting and when anyone writes a complicated batch script im so impressed I can’t speak. But it was powershell that won out. Wish is still there if you want to mess with it. Maybe , depending on your settings, because it became a popular way to install viruses
And now it’s worse - it’s being updated! Monthly! Great- do the new cool rolling update thing- now I can be confused every month.
Good job Gary. Powershell really is an acquired taste. It's so verbose, but I suppose in the right hands (not mine!!!) it can be very useful.
ОтветитьInteresting how some people value short commands and some others value commands that are easy to read and understand
ОтветитьAs Oliver said, "More, please sir".
ОтветитьNice
Ответитьthis is such an enjoyable video!!!
ОтветитьThanks for finally showing me how powershell is useful!
I have just been using as a cmd prompt replacement, but these examples alone are very useful for debugging.
I am going to start using cmdlets now, thanks for setting me on the path. 🙂
Instead of trying to engineer this janky shell that’s trying to be as bash is to Linux, why not just replace the weird, creaky underpinnings of Windows with Linux and get the real thing?
ОтветитьI don't know why I am watching this. I only have Linux PC's. Still watching though.
ОтветитьExcellent! I could have learned this myself, if I wasn't such an idle dinosaur. However you have prompted me to look into this, install PS 7, observe that there's some interesting connection with Visual Code and resolve to look into SSH-ing from PS direct into a RPi rather than via PuTTY. Very educational!
ОтветитьIt's a much better cmd, indeed. But even the last time I use Windows, I install and use MSYS instead.
ОтветитьThanks for another great and interesting vide, though a "Funny thing" happened to me when installing the "updated version" of the Powershell.
Now I guess I must have "missed something", but to me everything looked if it was the same as in Your video, until I had installed the "7.26.." version.
But after closing down my PowerShell (V.5.1,19041) and pressing the "Windows-key" and starting to type "pow" I now had 2 ""apps"" named "PowerShell"?
One that was the "old PowerShell"(V.5.1.19...) which is installed in "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe".
And the other one was the "New One", called "PowerShell 7 (x64)"(V.7.2.6) which had been installed in "C:\Program Files\PowerShell\7\pwsh.ex"
Not that it directly "hurt anything" but it did surprise me somewhat...And I thought it might be worth mentioning, just in case it happens to someone else as well
Best regards
[[P.S, this happened 2022-09-08, running: Win10.Pro(64bit), V.21H2, Build:19044.1889]]
Most of these cases can be easily done in just CMD. The real killer feature of PS though is complex cases involving working with and passing data objects.
ОтветитьCommand aliases is a saving grace for the PowerShell. Now, if it wasn't such a slow and bloated piece of software...
Ответить@Gary Explains Analysis on the A16 please 🙏
Ответитьwhere are your ears?
ОтветитьHow to bash, Poweshelll… mic drop
ОтветитьPowershell is pure complicated garbage 🗑️🚮
ОтветитьHi Gary, Another great explanation. I grew up with CP/M, MS DOS and several varieties of Unix-based shell. Over the last 20 years I have only used PowerShell when I really needed to as it always seemed excessively complicated and verbose. However, if I had learned the tips you gave earlier maybe I would not have been so reluctant to use it.
ОтветитьVery enlightening, thank you!
Ответитьssh and scp are shipped with Windows 10. They have nothing to do with PowersHell. You can run them from cmd too.
ОтветитьThis was fairly new to me. Was anyone else new to this surprised by the amount of processes running on their pc compared to Gary's? A lot of them were "svchost", had to look them up to see what they were about!
ОтветитьNice in linux powershell acts similar except the aliases are not there I had to build the aliases for ps and kill so I could use those commands in linux.
That might be useful.
You do say some amusing things Gary, "You may get to like Windows..."
ОтветитьSSH keys
ОтветитьTypical linux commands are aliased to PS counterparts, so stuff like ls is already Get-ChildItem. PS is superior to bash imo. No weird syntax rules, parameter autocompletion, for cli stuff it handles everything like parameters, colors out of the box. Things are returned as objects with properties — no more retarded string cutting with regexes to get anything done (tho there is still quite some of that). You also have everything C# has at your disposal, so it's a powerhouse. If I have some script to share on windows I prefer it over python as there is no setup required like module installation, versioning issues — it just works.
Ответитьshouldn't sl be aliased to steam-locomotive?
Ответить