Merge pull request #1886 from miketimofeev/vs-install-worakround

[windows] Temporary workaround for VS installation
This commit is contained in:
Maxim Lobanov
2020-10-23 12:43:33 +03:00
committed by GitHub

View File

@@ -3,6 +3,10 @@
## Desc: Install Visual Studio
################################################################################
# Temporary replace ip for download server to the one with the correct files and backup hosts file
Copy-Item -Path "$env:windir\System32\drivers\etc\hosts" -Destination "C:\hosts_backup" -Verbose
"68.232.34.200 download.visualstudio.microsoft.com" > "$env:windir\System32\drivers\etc\hosts"
$toolset = Get-ToolsetContent
$requiredComponents = $toolset.visualStudio.workloads | ForEach-Object { "--add $_" }
$workLoads = @(
@@ -47,4 +51,6 @@ if (Test-IsWin19) {
Install-Binary -Url $sdkUrl -Name $sdkFileName -ArgumentList $argumentList
}
Invoke-PesterTests -TestFile "VisualStudio"
Invoke-PesterTests -TestFile "VisualStudio"
# Restore hosts file after VS installation
Move-Item -Path "C:\hosts_backup" -Destination "$env:windir\System32\drivers\etc\hosts" -Force -Verbose