How to do it...

Get-Command can help determine the best cmdlet for a task. To find cmdlets, follow the steps below:

  1. At the Terminal, type pwsh to invoke PowerShell.
  2. Enter Get-Command to get a list of all cmdlets available in PowerShell. The number of cmdlets returned would change based on when you last updated PowerShell and the modules you've loaded.
PS> Get-Command

This may not be particularly useful—what would you do with a list of commands if you were looking for something to list out the currently-running processes?

  1. A process is a noun. We want a list of cmdlets that work on processes. At the prompt, type:
PS> Get-Command -Noun Process

Note that in PowerShell, the noun is in the singular form. Therefore, it's Process and not Processes.

  1. If you would like to further narrow down the list of cmdlets returned, add the verb as well.
PS> Get-Command -Verb Get -Noun Process
  1. If you're feeling lazy, or unsure of the exact conventions, you could even use the wildcard.
PS> Get-Command -Noun Proc*
  1. If you'd rather not write so much, and you're almost sure you know the partial cmdlet, you can straight away use wildcard search.
  2. If you know the name of the module which contains the cmdlet, you can even use the Module parameter when invoking Get-Command.
PS> Get-Command -Noun Process -Module Microsoft.PowerShell.Management
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.80.45