PowerTip: Use Windows PowerShell to display all Environment variables

Summary: Doctor Scripto demonstrates use [System.Environment] to show all currently set environment variables

A picture containing scissors

Description automatically generated

Question: Hey Doctor Scripto, I remember in DOS if I wanted to see the values of all the Environment variables; like TEMP I could just type the SET Command. How do I do this in PowerShell?

Answer: You can do this in one line using [System.Environment] to display all of the currently set Environment variables.

[System.Environment]::GetEnvironmentVariables()

PowerShell, Doctor Scripto, PowerTip, Sean Kearney

The post PowerTip: Use Windows PowerShell to display all Environment variables appeared first on Scripting Blog.

 

This article was originally published by Microsoft's Secure Blog. You can find the original article here.