Only back up installed Visual Studio versions
This commit is contained in:
parent
6e806af2a0
commit
72615ab002
1 changed files with 13 additions and 11 deletions
|
@ -20,19 +20,21 @@ $null = New-Module {
|
||||||
Write-Host "Backing up Visual Studio";
|
Write-Host "Backing up Visual Studio";
|
||||||
|
|
||||||
foreach ($version in $versions) {
|
foreach ($version in $versions) {
|
||||||
Write-Information "Backing up $($version[1]): $($version[2])";
|
if ((choco list -e $version[0])) {
|
||||||
|
Write-Information "Backing up $($version[1]): $($version[2])";
|
||||||
|
|
||||||
$configPath = Get-ConfigPath $context $version[0];
|
$configPath = Get-ConfigPath $context $version[0];
|
||||||
$null = New-Item -Force -ItemType Directory "$(Split-Path -Parent $configPath)";
|
$null = New-Item -Force -ItemType Directory "$(Split-Path -Parent $configPath)";
|
||||||
|
|
||||||
Start-Process -FilePath "$vsInstaller" `
|
Start-Process -FilePath "$vsInstaller" `
|
||||||
-Wait `
|
-Wait `
|
||||||
-ArgumentList @(
|
-ArgumentList @(
|
||||||
"export",
|
"export",
|
||||||
"--channelId", "$($version[1])",
|
"--channelId", "$($version[1])",
|
||||||
"--productId", "$($version[2])",
|
"--productId", "$($version[2])",
|
||||||
"--config", "`"$configPath`"",
|
"--config", "`"$configPath`"",
|
||||||
"--quiet");
|
"--quiet");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue