“PowerShell is great because I am flawed “- Jeffrey Snover
I’m a big fan of PowerShell: every-time there’s a problem I need to fix, I think “how can PowerShell help me here?” Back in July there was a great Session on the Microsoft Virtual Academy called “Getting Started with PowerShell”. It was hosted by Senior Technologist at Microsoft Jason Helmick and Distinguished Engineer and the Lead Architect for the Windows Server Division. Snover is the inventor of Windows PowerShell so to have a free 8 hour session on PowerShell by the guy that wrote the thing was an opportunity not to be missed. It was a cross between a gentle canter and a deep dive. It was broadcast on the 18th of July 2013. Typically videos are available to download roughly 2 weeks after the initial broadcast, so it should be available now. Regardless of your experience of PowerShell I’d recommend a watch of this.
I’ve got a lot of time for Jeffrey Snover. Last year at TechEd 2012 I sat in on his Q&A. He speaks with a lot of common sense; his blog On Heroes highlights this sort of sensibility.
In the broadcast, Jeffrey explained the principles he had in mind when designing PowerShell. The naming of cmdlets was standardized to verb-noun, and therefore all cmdlets have a regular, self describing naming convention. There are a list of permitted verb, so that cmdlets are schema-ised (type get-verb to list of permitted verbs). Jeffrey explained that he didn’t want to have to memorize all the cmdlets, and so aliases were born. He also explained about the Get-Help cmdlet, which I’m going to delve into here.
Entering get-help in a PowerShell lists the help topics and how to use the Get-Help cmdlet.
Get-Help gets the help content that it displays from help files on your computer. Without the help files, Get-Help displays only basic information about commands. Some Windows PowerShell modules come with help files. However, beginning in Windows PowerShell 3.0, the modules that come with Windows do not include help files. To download or update the help files for a module in Windows PowerShell 3.0, use the Update-Help cmdlet. Running Update-Help will download the PowerShell help onto your computer. In fact if you ran Get-Help Update-Help you’ll get info on the Update-Help cmdlet.
I’m going to run Update-Help to download the latest help topics onto my computer. Depending on how much you need to download, and how good your internet connection is, this can take some time. Don’t forget to read the get-help update-help topic as it’ll tell you that you need to start PowerShell with the “Run As Administrator” option or else you won’t be able to download the help files.
You can also view the help topics for Windows PowerShell online in the TechNet Library. To get the online version of a help topic, use the Online parameter, such as: Get-Help Get-Process -Online. This opens up a webpage with the help. You might notice that the info given on the webpage appears to be more than simply running get-help. If you don’t want to have to go online to get this level of info you can run Get-Help -detailed to get the same info.
What I like about the examples is that they’ve worked really hard on allowing you to explore and expand your own knowledge. One example shows us that some features have help articles that begin with “about_”, such as “about_signing” which you will need to know about if you want to run your own modules or scripts on a machine. But if you don’t know what topics have “about_” articles, how can you know what they are? The example show us that f you enter “get-help about _*” then you get the whole list of topics that have “about_” articles.
Getting the example is this way is a new feature in PowerShell 3. But my favourite new feature of PowerShell 3 is the parameter”-showwindow”. It opens up the help in a completely separate window, not a PowerShell console.
There’s a whole heap of features for PowerShell beyond the built in cmdlets or scripts that you can write, and this is just a small subset of what you can do. I highly recommend watching the PowerShell video.Follow @rPh0enix