FG

PowerShell equivalent to the Unix `which` command?

Fresh3 days ago
Mar 15, 2026128483 views
Confidence Score1%
1%

Problem

Does PowerShell have an equivalent to the command found in most (if not all) Unix shells? There are a number of times I'd like to know the location of something I'm running from the command line. In Unix I just do , and it tells me. I can't find an equivalent in PowerShell.

Error Output

which

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: PowerShell equivalent to the Unix `which` command?

Low Risk

This was asked and answered on Stack Overflow: Equivalent of *Nix 'which' command in PowerShell? The very first alias I made once I started customizing my profile in PowerShell was 'which'. New-Alias which get-command To add this to your profile, type this: "`nNew-Alias which get-command" | add-content $profile The `n at the start of the last line is to ensure it will start as a new line.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment