Monday, September 26, 2011

PowerShell V3 and Updateable Help

With PowerShell v2, the help information you can get using Get-Help is fixed. if there are errors in the help information, Microsoft is not going to up date them (until V3 ships). The logic is that PowerShell is a component of Windows and the Help text is not a critical or a security fix – thus we’re not gong to get hot fixes. And given the relatively high bar to bugs that are fixed by Service Packs (it has to be customer impacting - it’s tough to argue erroneous help information falls into that category), thus the only way with V2 to get updated help is to wait for V3.

One good thing Microsoft did do for Version 2 was to add the –Online switch to Get-Help. This switch has Get-Help open a browser window and navigate to the on-line help in TechNet. Since TechNet content can get updated when appropriate, this has been the work around – go online for the latest help information. And looking at the online help topics, there have been a number of changes and fixes.

This changes at V3. With PowerShell V3, Help can be updated mid-version using the appropriately named Update-Help cmdlet. When you first start up PowerShell V3 (CTP1!), you get only basic help material. If you type ‘Get-Help Get-Help, you see the following:


As you can see from this screen shot, PowerShell can’t initially find the help information. If you try to run Get-Help About_*, you get none of the help topic files listed. Finally, at least for now, the help link shown in the screen shot takes you to V2 help, which doesn’t really help that much (for the obvious reason that V2 shipped with help information fully implemented). But the screen shot does tell you more or less how to fix the problem – use Update-Help.

When you installed PowerShell V3 CTP1, you downloaded a .cab file from Microsoft then expanded it. When you did the expansion, you created a HelpContent folder which contains the necessary information. With CTP1, help information is localised into German (de-DE), US English (en-US), Spanish (es-ES), French (fr-FR), Italian (it-IT), Japanese (ja-JP), Korean (ko-KR), Brazilian Portuguese (pt-BR), Russian (ru-RU) and Chinese (both zh-CN and zh-TW). So long as your OS is one of these languages, then just use Update-Help specifying the UI culture and the Source path to the Help .cab files. For reasons I’m sure of yet, you seem to need to specify the –Force parameter in order to force PowerShell to update the help information (this may be a feature of the early CTP). Like this:


in the longer term, this is going to be a great feature – being able to update help on your local system as Microsoft makes updates. In the short term, I suspect this my cause some confusion.


I have been playing with this some more. And I have noticed slightly different behaviour from Update-Help if you run it in the ISE. Hmmm.

1 comment:

AIEEE said...

WOW! Its really an impressive post.It is always great to see your posts. Your thoughtful insights are awesome. Thanks for sharing it.Great work!This post is very mush useful for me.I was wondering this stuff of information only.I am very delighted to know all the ideas of it.Thanks for sharing.