Only restore previously installed VS versions

This commit is contained in:
Manuel Thalmann 2024-03-24 17:17:57 +01:00
parent 79cc1e3db4
commit 22f3932ada

View file

@ -37,17 +37,16 @@ $null = New-Module {
Write-Host "Restoring Visual Studio";
foreach ($version in $versions) {
Write-Information "Restoring $($version[1]): $($version[2])";
$configFileName = Get-ConfigPath $context $version[0];
$arguments = "";
if (Test-Path $configFileName) {
Write-Information "Restoring $($version[1]): $($version[2])";
$arguments = "--config `"$configFileName`"";
}
choco install -y $version[0] --params "$arguments";
$context.RemoveDesktopIcon("CocosCreator*");
$context.RemoveDesktopIcon("Unity Hub*");
choco install -y $version[0] --params "$arguments";
$context.RemoveDesktopIcon("CocosCreator*");
$context.RemoveDesktopIcon("Unity Hub*");
}
}
}
}