Prevent reboots during installation

This commit is contained in:
Manuel Thalmann 2024-08-27 02:18:01 +02:00
parent 594e495e47
commit cb3707f8a0

View file

@ -27,7 +27,7 @@ Start-SoftwareInstaller @parameters -Installer {
if (-not (& { powershell -Command "Import-Module $module"; $?; })) { if (-not (& { powershell -Command "Import-Module $module"; $?; })) {
$feature = "NetFx3"; $feature = "NetFx3";
if ((Get-WindowsOptionalFeature -Online -FeatureName $feature).State -ne "Enabled") { if ((Get-WindowsOptionalFeature -Online -NoRestart -FeatureName $feature).State -ne "Enabled") {
Write-Host "Enabling ``$feature`` feature…"; Write-Host "Enabling ``$feature`` feature…";
choco install --source windowsFeatures -y $feature; choco install --source windowsFeatures -y $feature;
} }