One of the reasons I like PowerShell is its built-in help system (here is a nice post in case you don’t know how to use PowerShell’s built-in help). E.g.:
Get-Help Get-Command Get-Help Get-Command -Examples Get-Help Get-Command -Parameter Name
In fact, once you get comfortable using PowerShell help aka Get-Help, you start missing similar built-in documentation for other tools/scripting languages. Wouldn’t it be nice if one could use Get-He.lp for Windows command-line tools?:
Get-Help chkdsk Get-Help chkdsk -Examples Get-Help chkdsk -Paramater c
Say ‘Hello’ to Get-LegacyHelp! With Get-LegacyHelp you can retrieve help for built-in windows command line tools in a similar way as Get-Help works against PowerShell cmdlets.
How does it work? Importing the module (Get-LegacyHelp.psm1) and running Get-LegacyHelp (alias glh) the first time will perform the following steps:
- Download the Windows command line reference help file WinCmdRef.chm
- Download and extract the HTML Agility pack dll
- Decomple the .chm into separate .html files using hh.exe
- Rename the html files and extract the information (using HTML Agility Pack) into PSObject format
- Export the entire object to disk using Export-CliXml
Afterwards (and for any subsequent invocation):
- The XML is imported…
- Relevant information filtered..
- and the data is displayed in a similar format to the Get-Help output
The Module can be downloaded from my GitHub repository. It’s not perfect since the information is not consistently structured throughout the .chm file. If you want to improve it, please feel free to fork and share.