PowerShell: Printing Version and Inline Help

Advertise Here

, 2009-07, 2011-07-29

PowerShell is bundled with Windows 7 (released in 2009). If your Windows does not come with PowerShell, you can download PowerShell from Microsoft Technet at Source. Make sure you are downloading PowerShell version 2 or later.

To start PowerShell, press 【Win+r】 then type “powershell”.

Finding Out Version

To find out your PowerShell version, type “$PSVersionTable” while in PowerShell. For example, here's my output:

PS C:\Users\h3> $PSVersionTable

Name                           Value
----                           -----
CLRVersion                     2.0.50727.5446
BuildVersion                   6.1.7601.17514
PSVersion                      2.0
WSManStackVersion              2.0
PSCompatibleVersions           {1.0, 2.0}
SerializationVersion           1.1.0.1
PSRemotingProtocolVersion      2.1

Note: PowerShell executable's folder path may say “v1.0”, but that is not the real version number.

Command Line Help

PowerShell has extensive built-in help system. Just type “help” and read thru it.

#Some common help forms:

help dir             # display a short doc for “dir”
help dir -examples   # show examples of using “dir”
help dir -full       # display the complete doc, including examples

help *r              # display all commands ending in r
help help            # display doc for help itself

Take at least 15 minutes to get familiar with help, its content structure, formats, because you will be using it a lot.

Graphical Help

You might want to download the graphical help file, version 2, at: microsoft.com. The graphical help lets you read PowerShell documents like a web browser.

Tab for Name Completion

PowerShell supports name completion, by the Tab key. So, you can press the tab key and it will complete your typings. Press tab again to see the next choice.

The name completion can be applied to options as well. For example, type “help dir -e” then Tab.

blog comments powered by Disqus
2009-07