Using PowerShell Help

by Jul 10, 2015

To access the full PowerShell help, you first need to download help information from the Internet. Simply launch a PowerShell console with full Administrator privileges:

 
PS> Start-Process -FilePath powershell.exe -Verb runas 
 

Néxt, download the PowerShell help:

 
PS> Update-Help -UICulture en-us -Force 
 

Note: PowerShell help is available in English only. This is why you need to specify –UICulture and make sure you request English help files.

Once help is installed, on PowerShell 4.0 and better you are good to go. You can now display full help for a cmdlet, or show only the examples:

 
PS> Get-Help -Name Get-Random -ShowWindow

PS> Get-Help -Name Get-Random -Examples

NAME
    Get-Random
    
SYNOPSIS
    Gets a random number, or selects objects randomly from a collection.
    
    -------------------------- EXAMPLE 1 --------------------------
    
    PS C:\>Get-Random
    3951433
    
    
    This command gets a random integer between 0 (zero) and Int32.MaxValue.
    
    
    
    
    -------------------------- EXAMPLE 2 --------------------------
    
    PS C:\>Get-Random -Maximum 100
    47
    
    
    This command gets a random integer between 0 (zero) and 99.
    
    
    
   ...
 

On PowerShell 3.0, if you are not using the English language, you would first need to manually copy the help files from the en-US folder to your locale:

#requires -RunAsAdministrator
#requires -Version 3

$locale = $host.CurrentUICulture.Name
if ($locale -eq 'en-us')
{
    Write-Warning 'You are using the English locale, all is good.'
}
else
{
    Copy-Item -Path "$pshome\en-us\*" -Destination "$pshome\$locale\" -Recurse -ErrorAction SilentlyContinue -Verbose
    Write-Host "Help updated in $locale locale"
} 

Once the help files are copied to your locale, you can use the English help files on non-English systems as well.

Twitter This Tip! ReTweet this Tip!