June 13th, 2015

PowerTip: Find All PowerShell Cmdlets Except…

Doctor Scripto
Scripter

Summary: Learn how to find all Windows PowerShell cmdlets except those from a specific module.

Hey, Scripting Guy! Question How can I find all Windows PowerShell cmdlets that begin with the verb "get" but are not contained in the
           Windows PowerShell module named “PowerShellCookbook”?

Hey, Scripting Guy! Answer Use the Get-Command cmdlet, and use the Where method to filter that the module name does not equal
           “PowerShellCookbook”:

(Get-Command -Verb get).where({$_.modulename -ne 'powershellcookbook'})

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback