Fix broken setup script

This commit is contained in:
Manuel Thalmann 2023-06-22 15:43:16 +02:00
parent 20844ad068
commit a822f5f32e

View file

@ -1,6 +1,9 @@
$null = $env:WIN_COMPUTER_NAME;
$null = $env:SETUP_SCRIPT_NAME;
# Find `winiso` installation medium
$drives = & wmic volume get "DriveLetter,Label";
$drive = $($($drives | Select-String -Pattern "winiso") -split "\s+")[0];
[xml]$unattendedConfig = $(Get-Content "$drive\Autounattend.template.xml");
function Get-PassSettings {
@ -12,9 +15,6 @@ function Get-PassSettings {
return $unattendedConfig.SelectSingleNode("/unattend/settings[@pass='$passName']");
}
$drives = & wmic volume get "DriveLetter,Label";
$drive = $($($drives | Select-String -Pattern "winiso") -split "\s+")[0];
# Adjust unattended settings
$specializeSettings = Get-PassSettings "specialize";
$specializeSettings.SelectSingleNode("./component[@name='Microsoft-Windows-Shell-Setup']/ComputerName").InnerText = "$env:WIN_COMPUTER_NAME";