Teaching yourself Powershell

posted in: PowerShell | 0

There are a lot of really good resources out there to learn PowerShell!  One of the best ways to learn is to watch someone else do something and then do it yourself.  When you take lessons on any sort of musical instrument the instructor will have the same instrument right there with you and will show you how to play whatever song you’re learning.  Don Jones has written some books on PowerShell that are awesome supplements to his video series on YouTube.  Ed Wilson is one of the worlds best, too!

 

Don Jones PowerShell in a month of lunches book by Manning Press

  • The link above has downloads to two free chapters

Don Jones PowerShell in a month of lunches on YouTube a series of short 1-5 minute videos to learn PowerShell, by first watching.

 

One of the best Microsoft Scripting guys ever, and the initial Microsoft Scripting Guy, Ed Wilson has published a series of awesome books on PowerShell.

Windows PowerShell Step by Step  by Ed Wilson

Other books by Ed Wilson are available on his Author page

 

PowerShell itself

There is a plethora of help information inside PowerShell that you can get at by just using the Get-Help cmdlet.  Cmdlet is pronounced (command-let).

Notice how in this screen shot we’re about to get help on the get-process cmdlet, by running Get-Help Get-Process. In order to retrieve the help I would’ve had to hit enter and if I had included the -full parameter, I could’ve got even more info.

As you get more into powershell, you’ll realize that including the -full parameter is not as a big a deal as it sounds when you’re just starting out.

In the next screenshot, I show how to use the name parameter to get PowerShell to list out all the various help files it has about stuff.  The command is Get-Help -name about*

This is only part of the list, and you’ll need to run this on your PC to read the entire list.  Don’t worry, nothing bad can happen to your pc from trying any of this blog post.

Make sure to open the powershell session in Administrative mode, for full administrative affect.  Disclaimer: You can do all of this in non-admin mode; but, if you decide to try other things that you might read about or watch about, you’ll want to be in admin mode.  To open your powershell in admin mode you can modify the shortcut by first off creating it on your taskbar, and then shift+right click it and choose properties and then choose advanced, and finally click the run as administrator, then click Ok, apply, ok.

 

 

If you’re not able to click the advanced button, because it is grayed out, then just right click the powershell exe and choose run as administrator. The powershell exe is located at %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe.  %SystemRoot% = C:\Windows and sometimes bloggers type it that way to seem like they really know something, or to appear uber-smart and cool to their IT buds.

 

Now, let’s get back to the learning powershell thing.  After you’ve ran the get-help -name about* and found a command in the list to learn about, you can run get-help and then list the command.  For example if you wanted to learn about powershell variables you could run, Get-Help About_Variables

 

Then you can read all about it, and can try the examples.

Start learning about.

Aliases (Get-Help about_Aliases)

Variables – you already know this one

Parameters (Get-Help about_parameters)

Providers (Get-Help about_providers)

WMI cmdlets (Get-Help about_WMI_CmdLets)

And as you go through each about_topic and see new cmdlets, get-help about each new cmdlet, and don’t forget to use the -examples switch and the -full switch

If you’re a SharePoint pro and are reading this and are not sure how it applies, try running Get-Help Get-SPWebApplication

Happy Powershelling

 

Leave a Reply