Skip to content

Instantly share code, notes, and snippets.

@tuyendq
Created June 1, 2020 11:09
Show Gist options
  • Save tuyendq/f1b53cafd135b21b0a7be8b29d10ca5a to your computer and use it in GitHub Desktop.
Save tuyendq/f1b53cafd135b21b0a7be8b29d10ca5a to your computer and use it in GitHub Desktop.
Powershell - Path environment
# Add PERMENANT entry to %PATH% environment variable - Add to Registry
$addToPath = "C:\Program Files\Amazon\AWSCLIV2"
$currentPath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path
$newPath = "$currentPath;$addToPath"
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment