Make the PATH environment variable more readable using Powershell

write content of PATH environment variable


(cmd /c echo %path%).split(";")

Now update it

updating it like this

$env:path += $env:path+";C:\Program Files\Git\bin" works only in process – that means after powershell.exe had been closed it would not exist anymore

.NET to the rescue
$np = $env:path + ";C:\Program Files\Git\bin"
[Environment]::SetEnvironmentVariable("PATH", $np, "Machine")


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


Scripts, tools and tips, mostly around Microsoft SCCM and EMS

To The Point

Anything about Technology and Business

Brian's Power Windows Blog

Microsoft in the Enterprise. Windows, Hyper-V, Exchange, SQL, and more!

PowerScripting Podcast

Shownotes and links for the PowerScripting Podcast, a podcast to help people learn Windows Powershell

Learn Powershell | Achieve More

What is this Powershell of which you speak?

%d bloggers like this: