Set the name of the setup user properly
This commit is contained in:
parent
6997a800b9
commit
4f17c95487
|
@ -205,8 +205,15 @@ function Start-Setup {
|
|||
$computerName.InnerText = "$env:WIN_COMPUTER_NAME";
|
||||
|
||||
# Execute corresponding installer script after startup
|
||||
$oobeSystemSettings = Get-PassSettings "oobeSystem";
|
||||
$installationCommand = $oobeSystemSettings.SelectSingleNode("./ua:component/ua:FirstLogonCommands/ua:SynchronousCommand[last()]", $namespace);
|
||||
$oobeSettings = (Get-Component (Get-PassSettings "oobeSystem") "Microsoft-Windows-Shell-Setup");
|
||||
|
||||
foreach ($xpath in @("./ua:AutoLogon/ua:Username",
|
||||
"./ua:UserAccounts/ua:LocalAccounts/ua:LocalAccount/Name",
|
||||
"./ua:UserAccounts/ua:LocalAccounts/ua:LocalAccount/DisplayName")) {
|
||||
$oobeSettings.SelectSingleNode($xpath, $namespace).InnerText = $valhallaConfig.setupUser;
|
||||
}
|
||||
|
||||
$installationCommand = $oobeSettings.SelectSingleNode("./ua:FirstLogonCommands/ua:SynchronousCommand[last()]", $namespace);
|
||||
$newCommand = $installationCommand.ParentNode.AppendChild($installationCommand.CloneNode($true));
|
||||
|
||||
$newCommand.SelectSingleNode("./ua:CommandLine", $namespace).InnerText = `
|
||||
|
|
Loading…
Reference in a new issue