To update the path in powershell:
[Environment]::SetEnvironmentVariable("Path", "$Env:Path;C:\Directory", "Machine")