I'm trying to install Visual Studio Build Tools unattended, in PowerShell. I followed https://silentinstallhq.com/visual-studio-build-tools-2022-silent-install-how-to-guide/ and came up with this script:
Write-Host "Installing visual studio build tools..." -ForegroundColor Cyan
$exePath = "$env:TEMP\vs.exe"
Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vs_BuildTools.exe -UseBasicParsing -OutFile $exePath
Write-Host "layout..." -ForegroundColor Cyan
Start-Process $exePath -ArgumentList "--layout .\vs_BuildTools" -Wait
cd vs_BuildTools
Write-Host "actual installation..." -ForegroundColor Cyan
Start-Process vs_setup.exe -ArgumentList "--installPath $env:USERPROFILE\vs_BuildTools2022 --nocache --wait --noUpdateInstaller --noWeb --allWorkloads --includeRecommended --includeOptional --quiet --norestart" -Wait
however it keeps stuck on layout...
for hours. My guesses are that it either is asking for permission or some dialog opens. Is there a way to print what's happening?