File: vsenv.ps1

package info (click to toggle)
reproc 14.2.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 600 kB
  • sloc: ansic: 3,219; cpp: 749; makefile: 9
file content (15 lines) | stat: -rw-r--r-- 616 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
  Add-Content -Path $env:GITHUB_ENV -Encoding utf8 "$name=$value"
}