PowerShell: Find Command (Get-Command, gcm)

By Xah Lee. Date: . Last updated: .

Get program path

Get-Command name

check if a command name is in Environment Variable $env:path

Command means any of Cmdlet, Alias, Function, Script, app

  • Get-Command has alias gcm
gcm deno | Format-List
gcm 2026-07-07 22d82 ll
gcm 2026-07-07 22d82 ll

Show shadowed commands

Get-Command name -all

Search all, including commands of the same type that have the same name. By default, Get-Command gets only the commands that run when you type the command name.

Search command by name

Get-Command *z*

List command names that contain z.

pwsh Get-Command 2021-01-16 hVdbf
list all commands that contains z in name.
Get-Command name -UseFuzzyMatching

List command names that match letters in name.

Show full path in output

Get-Command name | Format-List

Make the full path of the command visible.

Get-Command name | select -Property Path

Show just full path of the command.

  • Select-Object has alias select
gcm deno | select source
gcm 2026-07-07 2324c ll
gcm 2026-07-07 2324c ll