3

When entering echo path on PowerShell on my Windows 11, nothing proper is showing up. I recall Windows 10 shows all environmental path variables, but not anymore?

talon
  • 123
  • 1
  • 12
  • 2
    `$env:Path.Split([IO.Path]::PathSeparator)` or alternatively, `[Environment]::ExpandEnvironmentVariables('%PATH%').Split([IO.Path]::PathSeparator)` – Santiago Squarzon Oct 08 '22 at 22:11

1 Answers1

7

ECHO %PATH% returns the value of the PATH environment variable when run in cmd.exe, but not PowerShell.

The PowerShell command you're looking for is as follows:

$env:PATH

If you need to list all environment variables in PowerShell, use gci env:. The equivalent command for cmd.exe is SET.

Please see this Stack Overflow post for more information.

Thanks to @mklement0 for the clarification.

Ramza
  • 113
  • 4