TECH
BLOG

List environment variables in a GUI with PowerShell

2020
4

Out-gridView is not implemented in PowerShell Core 6, so if you omit it from the command, it can be displayed in the terminal.

List environment variables in GUI

# long commands
get-childItem env: | out-GridView
# Short Commands
gci env: | ogv

List the environment variable PATH in GUI

# long commands
$env: PATH -split ';' | out-gridView
# Short Commands
$env: PATH -split ';' | ogv

The environment variable PATH is not duplicated, and the number of duplicates is displayed in a list

# long commands
$env: PATH -split ';' | Group-Object | Select-Object Name, Count | out-GridView
# Short Commands
$env: PATH -split ';' | group | select Name, Count | ogv

List non-existing folders from the PATH environment variable

# long commands
$env: PATH -split ';' | Where-Object {-Not (Test-Path -pathType Container $_)} | out-GridView
# Short Commands
$env: PATH -split ';' |? {! (Test-Path -pathType Container $_)} | ogv

RELATED PROJECT

No items found.