Skip to content

Instantly share code, notes, and snippets.

@IamAdiSri
Created June 3, 2019 09:57
Show Gist options
  • Save IamAdiSri/951a04f28b3cf1c5b8ea691abd5f7188 to your computer and use it in GitHub Desktop.
Save IamAdiSri/951a04f28b3cf1c5b8ea691abd5f7188 to your computer and use it in GitHub Desktop.
Windows PowerShell Profile Snippets
# Loads the Visual Studio Developer Command Prompt environment into Powershell
$installationPath = "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
if ($installationPath -and (test-path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -no_logo && set" | foreach-object {
$name, $value = $_ -split '=', 2
set-content env:\"$name" $value
}
}
echo "> Visual Studio Developer Command Prompt loaded onto environment."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment