Prof. Powershell

Can I Get a Little PowerShell Help?

When looking for cmdlet help, PowerShell 3 goes beyond version 2 with an Update-Help cmdlet.

Because Windows PowerShell is part of the operating system, updating help and documentation is difficult. I'm speaking only of the core PowerShell cmdlets like Get-Service and Get-WMIObject. Fortunately, in PowerShell 2.0 we could run help on a cmdlet and use the -Online parameter. This would direct our browser to the most current cmdlet documentation from MSDN:

PS C:\> help Get-WmiObject -online

You would have to run this every time and for every command if you wanted to get the most up to date documentation. And what about those systems without Internet access? Well, the forthcoming PowerShell 3.0 solves this problem with updatable help:

PS C:\> help About_Updatable_Help

From a machine connected to the Internet, all you need to do is run the Update-Help cmdlet:

PS C:\> Update-Help

To avoid excessive network traffic, you can only use the cmdlet once every 24 hours. But if you are troubleshooting a problem and need to rety a few times, then use the -Force parameter:

PS C:\> Update-Help -force

Naturally you would need to do this on all your computers running PowerShell 3.0 which is a lot of Internet traffic. The better approach is for one machine to save the help files locally using the Save-help cmdlet:

PS C:\> Save-Help \\file02\pshelp

PowerShell will download a number of CAB files. Now all you need to do is run Update-Help on the local computers using the -SourcePath parameter:

PS C:\> Update-Help -sourcepath \\file02\pshelp

Or you can take advantage of remoting:

PS C:\> Start-job { Update-Help -sourcepath \\file02\pshelp -force} -computers $computers

You might want to set this up as a scheduled task to run once a month. Or perhaps add a command to your PowerShell profile script to update help on a periodic basis such as every Monday:

if ((get-date).DayOfWeek -eq "Monday") {Update-Help}

PowerShell 3.0 still supports online help, but for more permanent updates, you'll want to start using Save-Help and Update-Help.

Note: This information is based on PowerShell 3.0 CTP 2 and is subject to change and most likely will prior to release.

About the Author

Jeffery Hicks is an IT veteran with over 25 years of experience, much of it spent as an IT infrastructure consultant specializing in Microsoft server technologies with an emphasis in automation and efficiency. He is a multi-year recipient of the Microsoft MVP Award in Windows PowerShell. He works today as an independent author, trainer and consultant. Jeff has written for numerous online sites and print publications, is a contributing editor at Petri.com, and a frequent speaker at technology conferences and user groups.

comments powered by Disqus
Most   Popular

Upcoming Training Events

0 AM
Live! 360 Orlando
November 17-22, 2024
TechMentor @ Microsoft HQ
August 11-15, 2025