Install Visual Studio: Silent
vs_enterprise.exe --export config.vsconfig
Open PowerShell or CMD and run:
FROM mcr.microsoft.com/windows/servercore:ltsc2022 COPY vs_enterprise.exe /installer/vs.exe COPY config.vsconfig /installer/config.vsconfig silent install visual studio
vs_enterprise.exe --layout C:\VS2022_Layout \ --add Microsoft.VisualStudio.Workload.NativeDesktop \ --add Microsoft.VisualStudio.Workload.Universal \ --includeRecommended --lang en-US Then, from the target machine, run the silent install from the layout:
$exitCode = Start-Process -Wait -PassThru vs_enterprise.exe -ArgumentList "--quiet --wait --norestart --add Microsoft.VisualStudio.Workload.NetWeb" if ($exitCode -eq 0) { Write-Host "Success!" } elseif ($exitCode -eq 3010) { Write-Host "Success, but reboot required." } else { Write-Host "Failed with code: $exitCode" } vs_enterprise
--nickname "DevOps Build Agent 2022" Here’s how you’d use this in a Windows container:
Whether you’re maintaining a build farm, onboarding new developers, or just tired of clicking "Modify," the --quiet flag is your new best friend. from the target machine
RUN C:/installer/vs.exe --quiet --wait --norestart --config C:/installer/config.vsconfig && del /f /q C:/installer Visual Studio is a massive tool, but it doesn't have to be a massive distraction. Silent installation turns a 45-minute manual process into a 5-minute scripted one.
Enter .
On a reference machine with the perfect VS setup, run:
