If you are like me and are just so used to typing set to list and set environment variables then you might find this script useful.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | if (test-path alias:set) { remove-item alias:set > $null } function set { [string]$var = $args if ($var -eq "") { get-childitem env: | sort-object name } else { if ($var -match "^(\S*?)\s*=\s*(.*)$") { set-item -force -path "env:$($matches[1])" -value $matches[2]; } else { write-error "ERROR Usage: VAR=VALUE" } } } |







