Skip to main content

Windows: Get local environment variables

Using Powershell

Get-ChildItem Env:

Do not forget colon (":") after Env.

Powershell: Get local environment variables
Powershell: Get local environment variables
Get a specific local variable, such as Path, ComputerName...
Get-ChildItem Env:Path | Format-List

Remember to add " | Format-List" to display full result.
Get Path local environment variable
Get Path local environment variable

Using Command Prompt

Just type SET without any parameters to display all the current environment variables.
Command Prompt: Get local environment variables
Command Prompt: Get local environment variables

Popular posts from this blog

Powershell: Check Bad Logon

get-aduser -Filter {BadLogonCount -ne 0} -properties * | select SamAccountName,BadLogonCount,BadPasswordTime,BadPwdCount,@{name='badPasswordTimeDT'; expression={[datetime]::fromFileTime($_.badPasswordTime)}} | sort BadPasswordTime | FT

MSSQL: Fix error 'Consistency validation for SQL Server registry keys'

While installing Microsof SQL Server 2012, I ran into the following error. "The SQL Server registry keys from a prior installation cannot be modified. To continue, see SQL Server Setup documentation about how to fix registry keys." How to fix Replace the D:\x64\FixSqlRegistryKey_x86.exe file with the original file from the ENU\SQLFULL_ENU.iso file downloading from Microsoft Download Center. This ISO file is 4.2GB. So you can click FixSqlRegistryKey_x86.exe to download this file only. After replacing that file, press Re-run to check. All rules are passed.