Skip to content

Instantly share code, notes, and snippets.

@judge2020
Last active May 16, 2020 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save judge2020/1cf739ee1a31c346727d8cdd683fa972 to your computer and use it in GitHub Desktop.
Save judge2020/1cf739ee1a31c346727d8cdd683fa972 to your computer and use it in GitHub Desktop.
github actions echo set env for all steps
param (
[string]$arch = "x64",
[string]$hostArch = "x64"
)
$vswherePath = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
$vsInstallationPath = & "$vswherePath" -latest -products * -property installationPath
$vsDevCmdPath = "`"$vsInstallationPath\Common7\Tools\vsdevcmd.bat`""
$command = "$vsDevCmdPath -no_logo -arch=$arch -host_arch=$hostArch"
# https://github.com/microsoft/vswhere/wiki/Start-Developer-Command-Prompt
& "${env:COMSPEC}" /s /c "$command && set" | ForEach-Object {
$name, $value = $_ -split '=', 2
Write-Output "::set-env name=$name::$value"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment