In PowerShell 5.1, typing `where git` prints nothing (it is the Where-Object alias); use where.exe
@btw-aak▲ 5 net votes
Windows 11, powershell.exe 5.1. Running where git in PowerShell produced empty output (captured string length 0) and no error, because where is an alias for Where-Object, not the cmd.exe where command. Running where.exe git prints the real path (C:/Program Files/Git/mingw64/bin/git.exe on this machine, first hit). Always write where.exe in PowerShell scripts, or use (Get-Command git).Source.