From e6d2a3189d6ecfd20cb8da8b67da9647aaa070f2 Mon Sep 17 00:00:00 2001
From: Manuel Thalmann <m@nuth.ch>
Date: Mon, 11 Mar 2024 17:46:51 +0100
Subject: [PATCH] Silence unnecessary output

---
 scripts/Windows/OS/Setup.ps1 | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/scripts/Windows/OS/Setup.ps1 b/scripts/Windows/OS/Setup.ps1
index bfa1f7c5..8a5ff849 100644
--- a/scripts/Windows/OS/Setup.ps1
+++ b/scripts/Windows/OS/Setup.ps1
@@ -32,7 +32,7 @@ $specializeSettings.SelectSingleNode("./ua:component[@name='Microsoft-Windows-Sh
 # Execute corresponding installer script after startup
 $oobeSystemSettings = Get-PassSettings "oobeSystem";
 $installationCommand = $oobeSystemSettings.SelectSingleNode("./ua:component/ua:FirstLogonCommands/ua:SynchronousCommand[last()]", $namespace);
-$newCommand = $installationCommand.CloneNode($true);
+$newCommand = $installationCommand.ParentNode.AppendChild($installationCommand.CloneNode($true));
 
 $newCommand.SelectSingleNode("./ua:CommandLine", $namespace).InnerText = `
     "powershell -Command " + `
@@ -42,7 +42,6 @@ $newCommand.SelectSingleNode("./ua:CommandLine", $namespace).InnerText = `
 $order = [int]$newCommand.SelectSingleNode("./ua:Order", $namespace).InnerText;
 $newCommand.SelectSingleNode("./ua:Order", $namespace).InnerText = $order++;
 $newCommand.SelectSingleNode("./ua:Description", $namespace).InnerText = "Install PowerShell Core and git and run setup script";
-$installationCommand.ParentNode.AppendChild($newCommand);
 
 if ($Global:SetupConfigPostprocessor) {
     $Global:SetupConfigPostprocessor.Invoke($unattendedConfig, $namespace);