PowerTip: Find All PowerShell Cmdlets Except…

Doctor Scripto

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'})

0 comments

Discussion is closed.

Feedback usabilla icon