Whenever I use Powershell, I have access to commands like npm, npx, git, etc. Is there a way that I can easily list all of those available commands that I have added through my environment variable PATH? I've tried using Get-Variable and Get-Command without luck of finding git and all my environment variable commands.
2 Answers
Use a Regular Expression on the output of Get-Command:
Get-Command -Type Application | Where Name -Match 'git|npm|npx'
1 Comment
DJ Poland
Oh wow. I was really looking for Get-Command -Type Application, but this is even better. Thanks!
Just do this:
Set-Location Env:
Get-ChildItem
EDIT: In More detail: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables?view=powershell-5.1
1 Comment
DJ Poland
I tried, but after doing "Get-ChildItem | grep git/npm/npx" I can't find the commands. I do see the key/value pair of my environment variables from doing your command(s) though.