Visual Studio Build Tools Container
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
834 B

7 months ago
param([parameter()][string] $msvc="C:\msvc")
new-item -path $msvc -type directory -force
new-item -path "temp" -type directory -force
invoke-webrequest https://aka.ms/vs/15/release/channel -outfile temp\visualstudio.release.chman
invoke-webrequest https://aka.ms/vs/15/release/vs_buildtools.exe -outfile temp\vs_buildtools.exe
$arguments = @(
"--quiet", "--wait", "--norestart", "--nocache",
"--channeluri", ($pwd.path + "\temp\visualstudio.release.chman"),
"--installchanneluri", ($pwd.path + "\temp\visualstudio.release.chman"),
"--config", ($pwd.path + "\vs15.config"),
"--installpath", "$msvc"
)
$proc = Start-Process -FilePath "temp\vs_buildtools.exe" -ArgumentList $arguments
$proc.WaitForExit()
Remove-Item "temp" -Recurse
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$msvc", "Machine")