diff --git a/seediso/windows11/Autounattend.xml b/seediso/windows11/Autounattend.xml index f262c21..95edb89 100644 --- a/seediso/windows11/Autounattend.xml +++ b/seediso/windows11/Autounattend.xml @@ -162,7 +162,7 @@ 1 Configure Windows from the answer-media script - powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "$script = Get-ChildItem -Path (Get-PSDrive -PSProvider FileSystem).Root -Filter 'Configure-Windows.ps1' -File -ErrorAction SilentlyContinue | Select-Object -First 1; if (-not $script) { throw 'Configure-Windows.ps1 was not found on the attached media.' }; & $script.FullName" + powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "$script = Get-ChildItem -Path (Get-PSDrive -PSProvider FileSystem).Root -Filter 'Configure-Windows.ps1' -File -ErrorAction SilentlyContinue | Select-Object -First 1; if (-not $script) { throw 'Configure-Windows.ps1 was not found on the attached media.' }; & $script.FullName -InstallVirtIO -EnableAutomaticLogon" false diff --git a/seediso/windows11/Configure-Windows.ps1 b/seediso/windows11/Configure-Windows.ps1 index 9ac2203..91295f1 100644 --- a/seediso/windows11/Configure-Windows.ps1 +++ b/seediso/windows11/Configure-Windows.ps1 @@ -1,3 +1,8 @@ +param( + [switch]$InstallVirtIO, + [switch]$EnableAutomaticLogon +) + $ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest @@ -91,7 +96,11 @@ function Enable-AutomaticLogon { Remove-ItemProperty -Path $winlogonPath -Name 'AutoLogonCount' -ErrorAction SilentlyContinue } -Install-VirtIOGuestTools +if ($InstallVirtIO) { + Install-VirtIOGuestTools +} Install-OpenSSHServer Install-AdministratorAuthorizedKey -Enable-AutomaticLogon +if ($EnableAutomaticLogon) { + Enable-AutomaticLogon +}