Summary: Learn to expand the value of environmental variables by using Windows PowerShell.
How can I use Windows PowerShell to find the value of a common environmental variable
such as %username% or %computername%?
Use the ExpandEnvornmentalVariables static method from the
System.Environment .NET Framework class, for example:
[System.Environment]::ExpandEnvironmentVariables("%username%")
[System.Environment]::ExpandEnvironmentVariables("%computername%")