Skip to content

Commit 64587db

Browse files
authored
Adding powershell script to install framework 4.6.1
Hopefully this will aid in fixing the failing build action.
1 parent 26e3658 commit 64587db

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
2+
$InstallPath = "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise"
3+
$componentsToAdd = @(
4+
"Microsoft.Net.Component.4.6.1.SDK"
5+
)
6+
[string]$workloadArgs = $componentsToAdd | ForEach-Object {" --add " + $_}
7+
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
8+
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
9+
if ($process.ExitCode -eq 0)
10+
{
11+
Write-Host "components have been successfully added"
12+
}
13+
else
14+
{
15+
Write-Host "components were not installed"
16+
exit 1
17+
}

0 commit comments

Comments
 (0)