Fix broken setup script
This commit is contained in:
parent
20844ad068
commit
a822f5f32e
1 changed files with 3 additions and 3 deletions
|
@ -1,6 +1,9 @@
|
||||||
$null = $env:WIN_COMPUTER_NAME;
|
$null = $env:WIN_COMPUTER_NAME;
|
||||||
$null = $env:SETUP_SCRIPT_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");
|
[xml]$unattendedConfig = $(Get-Content "$drive\Autounattend.template.xml");
|
||||||
|
|
||||||
function Get-PassSettings {
|
function Get-PassSettings {
|
||||||
|
@ -12,9 +15,6 @@ function Get-PassSettings {
|
||||||
return $unattendedConfig.SelectSingleNode("/unattend/settings[@pass='$passName']");
|
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
|
# Adjust unattended settings
|
||||||
$specializeSettings = Get-PassSettings "specialize";
|
$specializeSettings = Get-PassSettings "specialize";
|
||||||
$specializeSettings.SelectSingleNode("./component[@name='Microsoft-Windows-Shell-Setup']/ComputerName").InnerText = "$env:WIN_COMPUTER_NAME";
|
$specializeSettings.SelectSingleNode("./component[@name='Microsoft-Windows-Shell-Setup']/ComputerName").InnerText = "$env:WIN_COMPUTER_NAME";
|
||||||
|
|
Loading…
Reference in a new issue