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.
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"
}
}
}
Just add this script to your Powershell profile and you will be all set :)
PS: If anyone is interested I updated the Powershell Language definitions for CodeHTMLer, it now highlights more of the built-in stuff such as cmdlets and variables.