PowerShell Get-Command

Get-Command in PowerShell

Get-Command is a cmdlet in PowerShell that allows us to retrieve a list of commands that are available to use in the current session. This cmdlet is useful for discovering new commands and learning more about their usage & capabilities.

We can query commands using wildcards as displayed in this example:

# get-command, better use wildcards *
Get-Command test-sql*
PowerShell Get Command Wildcard

We can list commands that belong to a specific PowerShell module, or that have a specific verb or noun in their name. For example, run Get-Command Test-* to retrieve all PowerShell cmdlets with the ‘Test’ prefix.

If you found this tip useful, you may be interested in checking out my other PowerShell Tips. I regularly publish new content on my blog, including helpful tips and tricks for working with PowerShell.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *