Setting Up a Windows PowerShell Help Repository

With the help files not available by default in PowerShell V3, you must now use Update-Help to download the help files needed to properly view help for each cmdlet. The best thing about this is that you will always have the most updated help available for your PowerShell cmdlets. You find something wrong with the help, file it on the Connect site and as soon as it gets fixed, it is now available to you when you download the help again! And by the way, if you haven’t checked out the Connect site, do so now! There are some great bugs and feature requests that you can vote up to get looked at. Plus, the PowerShell team DOES pay attention to these and will comment and resolve these requests.  How cool is that?

So what happens in an enterprise when all of the servers do not have access to the internet to download the help files for use?  Fortunately, the answer is simple! You can build a repository of help files on a file server that other systems can access. All you need is a system that has internet access to download the files.

How you setup your repository is up to you,  just make sure that your systems have access to the repository. :) If you don’t have an internet accessible system, you can save the files to a CD and then copy them to your repository for sharing with other systems.

#Create the repository folder
New-Item -Path "D:" -Name PoshHelp -ItemType Directory
#Share the folder
net share PoshHelp=D:\PoshHelp /Grant:"Authenticated Users",Full

My share is set up on my server, DC1 and is called PoshHelp.

image

Once that is done, we can now use Save-Help with the –Destination parameter to specify the location of the repository.

#Download the help files to the new share
Save-Help -DestinationPath "\\DC1\PoshHelp" -Module * -Force -ErrorAction SilentlyContinue

image

I specified –Module * so everything is downloaded and –ErrorAction SilentlyContinue just because I know that there will be errors, none of which I can resolve on my own. Without the –Module *, only the currently loaded modules in the session and installed modules will be loaded. The –Force overrides the once-per-day limitation, version checking, and the 1 GB per module limit.

OK, now lets take a look a look at my repository to see if the files have been downloaded.

Get-ChildItem -Path "\\dc1\poshhelp"

image

Looks like they are there to me. Now that leads to the next and last step in the process: update the help on one of my systems.

#Get updated help
Update-Help -Module * -SourcePath "\\DC1\PoshHelp" -Force -ErrorAction SilentlyContinue

image

And just like that, we now have the latest help in PowerShell. Almost too easy!

Just remember to run the Save-Help from time to time to update the repository ( a scheduled job would be a nice thing for this sort of task, if possible on your network). You could even set up a system profile on each system to run the Update-Help against the repository so each user will have the latest help available whenever they run the console.

About these ads

About Boe Prox

Microsoft PowerShell MVP working as a Senior Systems Administrator
This entry was posted in powershell, V3 and tagged , , , , . Bookmark the permalink.

2 Responses to Setting Up a Windows PowerShell Help Repository

  1. Pingback: Episode 192 – Eric Williams from Cisco on the UCS PowerTool « PowerScripting Podcast

  2. Pingback: Репозиторий справочных файлов для PowerShell V3 - wAdmin.ru

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s