5 Tips to Help You Learn Windows PowerShell

5 Tips to Help You Learn Windows PowerShell

Gary Explains

1 год назад

40,710 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

samuel
samuel - 18.09.2023 16:45

pwsh is amazing

Ответить
Surgi Ical Strike
Surgi Ical Strike - 19.06.2023 18:26

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.

Ответить
Silvermist78
Silvermist78 - 17.06.2023 09:08

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! 👍🙏

Ответить
Nameless Boy
Nameless Boy - 22.04.2023 02:12

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....

Ответить
Samer Hassouneh
Samer Hassouneh - 09.01.2023 20:47

ihy has an alias of 'r' (without quotes). Makes it even easier

Ответить
Raj Upadhyay
Raj Upadhyay - 19.10.2022 01:34

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.

Ответить
Foymanatee
Foymanatee - 05.10.2022 19:08

I just join your channel.. would like to see windows powershell lessons

Ответить
Anders Jackson
Anders Jackson - 05.10.2022 01:31

How to install Emacs? Can that be done through winget?

Ответить
Algerco Malki Malek
Algerco Malki Malek - 01.10.2022 00:49

Great ! TA !

Ответить
Piotr Polkowski
Piotr Polkowski - 30.09.2022 15:32

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

Ответить
Chaminda Prasad
Chaminda Prasad - 23.09.2022 14:35

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

Ответить
matsim0
matsim0 - 22.09.2022 22:50

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???

Ответить
Rood67
Rood67 - 22.09.2022 21:13

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.

Ответить
John Dripper
John Dripper - 20.09.2022 23:01

Lol😂😂 power shell is quite powerful compared to cmd

Ответить
Charles Kuperus
Charles Kuperus - 19.09.2022 12:03

So the new version of PowerShell is no longer only on Windows it is also on Linux and Mac os.

Ответить
Ufuoma Okoro
Ufuoma Okoro - 18.09.2022 13:53

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 🙏

Ответить
nhan Nguyen
nhan Nguyen - 17.09.2022 13:02

Wow i didn't know 1 day I'll say this but. Powershell look kind of good!

Ответить
kingofcastlechaos
kingofcastlechaos - 17.09.2022 01:41

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.

Ответить
Peter Andersson
Peter Andersson - 16.09.2022 20:46

Give powertype a try (I'm the creator)

Ответить
Andy T
Andy T - 15.09.2022 18:30

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

Ответить
Adam Stock
Adam Stock - 15.09.2022 18:25

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 ?

Ответить
Andy T
Andy T - 15.09.2022 18:23

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.

Ответить
Dan Stocks
Dan Stocks - 14.09.2022 20:28

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.

Ответить
Darwin R
Darwin R - 14.09.2022 04:21

Interesting how some people value short commands and some others value commands that are easy to read and understand

Ответить
Muddy Export
Muddy Export - 13.09.2022 19:25

As Oliver said, "More, please sir".

Ответить
Félix A.G
Félix A.G - 12.09.2022 19:12

Nice

Ответить
bitelogger
bitelogger - 12.09.2022 13:22

this is such an enjoyable video!!!

Ответить
Triforce of Shadows
Triforce of Shadows - 12.09.2022 00:22

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. 🙂

Ответить
Tom English Music
Tom English Music - 10.09.2022 16:18

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?

Ответить
Marcus K
Marcus K - 10.09.2022 08:28

I don't know why I am watching this. I only have Linux PC's. Still watching though.

Ответить
William Stevenson
William Stevenson - 10.09.2022 00:40

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!

Ответить
Mario Ray Mahardhika
Mario Ray Mahardhika - 09.09.2022 18:29

It's a much better cmd, indeed. But even the last time I use Windows, I install and use MSYS instead.

Ответить
M Rdr
M Rdr - 09.09.2022 00:38

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]]

Ответить
AlexXx
AlexXx - 08.09.2022 14:47

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.

Ответить
AlexXx
AlexXx - 08.09.2022 14:25

Command aliases is a saving grace for the PowerShell. Now, if it wasn't such a slow and bloated piece of software...

Ответить
Avarosa
Avarosa - 08.09.2022 04:43

@Gary Explains Analysis on the A16 please 🙏

Ответить
JevWeazle
JevWeazle - 08.09.2022 03:27

where are your ears?

Ответить
Kimberly Jacobsen
Kimberly Jacobsen - 08.09.2022 01:02

How to bash, Poweshelll… mic drop

Ответить
anjan bora
anjan bora - 07.09.2022 19:34

Powershell is pure complicated garbage 🗑️🚮

Ответить
gilmoretj
gilmoretj - 07.09.2022 18:57

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.

Ответить
Percy Phelps
Percy Phelps - 07.09.2022 05:45

Very enlightening, thank you!

Ответить
John
John - 07.09.2022 04:58

ssh and scp are shipped with Windows 10. They have nothing to do with PowersHell. You can run them from cmd too.

Ответить
PsillyPseudonym
PsillyPseudonym - 06.09.2022 23:12

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!

Ответить
Jeff Sadowski
Jeff Sadowski - 06.09.2022 22:06

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.

Ответить
Peter Williams
Peter Williams - 06.09.2022 21:58

You do say some amusing things Gary, "You may get to like Windows..."

Ответить
Karthikraja
Karthikraja - 06.09.2022 20:00

SSH keys

Ответить
Gosu
Gosu - 06.09.2022 19:58

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.

Ответить
Shane NT
Shane NT - 06.09.2022 19:25

shouldn't sl be aliased to steam-locomotive?

Ответить