Search for Keywords in Help Files

by Apr 4, 2011

You may be surprised that you cannot filter Help texts by keywords:

Get-Help Dir | Select-String "File"

This will not return anything,  even though there is a word called “file” in the Help text (at least in English versions of PowerShell so be sure to adjust the keyword if necessary).
This is because most cmdlets do not return text, but objects. You will need to first convert objects to text to search for text:

Get-Help Dir | Out-String Stream | Select-String File

 

Twitter This Tip!
ReTweet this Tip!