azure-sdk-for-cpp/eng/pipelines/templates/steps/setup-msvc.yml
Daniel Jurek ad30d104d6
Revert win2022 image back to latest and add msvc version mitigation (#5539)
* Revert win2022 image back to latest
* Workaround fix for MSVC SxS issue
2024-04-18 22:11:36 +00:00

22 lines
924 B
YAML

# This temporary fix resolves an issue on Win2022 machines that have multiple
# MSVC versions installed side-by-side. When this issue is resolved, remove this
# template and references:
# https://github.com/actions/runner-images/issues/9701
steps:
- pwsh: |
$tempFile = New-TemporaryFile;
systeminfo.exe /fo csv > $tempFile
$osName = (Import-Csv $tempFile).'OS Name'
Write-Host "OS Name: $osName"
if (!($osName -like '*2022*')) {
Write-Host "OS is not Windows Server 2022, skipping MSVC changes"
exit 0
}
Remove-item 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\Microsoft.VCToolsVersion.v143.default.*' -Force
Get-ChildItem 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\' -Name | Write-Host
displayName: Setup MSVC
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))