nav-arm-templates/Install-VS2017Community.ps1

24 строки
1.3 KiB
PowerShell
Исходник Постоянная ссылка Обычный вид История

2020-06-11 13:57:10 +03:00
if (!(Test-Path function:AddToStatus)) {
function AddToStatus([string]$line, [string]$color = "Gray") {
2020-06-11 16:02:55 +03:00
("<font color=""$color"">" + [DateTime]::Now.ToString([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortTimePattern.replace(":mm",":mm:ss")) + " $line</font>") | Add-Content -Path "c:\demo\status.txt" -Force -ErrorAction SilentlyContinue
2017-10-11 07:00:20 +03:00
Write-Host -ForegroundColor $color $line
}
}
$Folder = "C:\DOWNLOAD\VisualStudio2017Community"
$Filename = "$Folder\vs_community.exe"
New-Item $Folder -itemtype directory -ErrorAction ignore | Out-Null
if (!(Test-Path $Filename)) {
2020-06-11 13:57:10 +03:00
AddToStatus "Downloading Visual Studio 2017 Community Setup Program"
2017-10-11 07:00:20 +03:00
$WebClient = New-Object System.Net.WebClient
$WebClient.DownloadFile("https://aka.ms/vs/15/release/vs_community.exe", $Filename)
}
2020-06-11 13:57:10 +03:00
AddToStatus "Installing Visual Studio 2017 Community (this might take a while)"
2017-10-11 07:00:20 +03:00
$setupParameters = --quiet --norestart"
Start-Process -FilePath $Filename -WorkingDirectory $Folder -ArgumentList $setupParameters -Wait -Passthru | Out-Null
$setupParameters = --quiet --norestart --add Microsoft.VisualStudio.Component.Windows10SDK.14393"
Start-Process -FilePath $Filename -WorkingDirectory $Folder -ArgumentList $setupParameters -Wait -Passthru | Out-Null