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")