Skip to content

Commit 8c88bed

Browse files
authored
refactor(): use choco for visual studio 2022 (#44)
Install Visual Studio 2022 Build Tools through chocolatey.
1 parent dd76a17 commit 8c88bed

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

WebKitDev/Functions/Install-VSBuildTools2022.ps1

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,18 @@ function Install-VSBuildTools2022 {
2121
[string]$installationPath
2222
)
2323

24-
$url = 'https://aka.ms/vs/17/release/vs_BuildTools.exe';
25-
26-
$options = @(
27-
'--quiet',
28-
'--norestart',
29-
'--nocache',
30-
'--wait'
31-
);
24+
$packageParameters = @();
3225

3326
foreach ($workload in $workloads) {
34-
$options += @('--add',$workload);
27+
$packageParameters += @('--add',$workload);
3528
}
3629

3730
if ($installationPath) {
38-
$options += @('--installPath',$installationPath);
31+
$packageParameters += @('--installPath',$installationPath);
3932
}
4033

41-
Install-FromExe -Name 'VSBuildTools2022' -url $url -Options $options -noVerify;
34+
Install-FromChoco `
35+
-Name visualstudio2022buildtools `
36+
-PackageParameters $packageParameters `
37+
-noVerify;
4238
}

0 commit comments

Comments
 (0)