From 9af52a8206f725f2888e06293241251fadbaec93 Mon Sep 17 00:00:00 2001 From: Miiraak Date: Sun, 31 Aug 2025 12:32:36 +0200 Subject: [PATCH] Add autounattend.xml download if missing Implement a check for the existence of `autounattend.xml`. If the file is not found, download it from a specified URL using `Invoke-RestMethod` and save it to the script's root directory. This ensures the configuration file is available for the script's execution. --- tiny11maker.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tiny11maker.ps1 b/tiny11maker.ps1 index 217fe69..2741ffd 100644 --- a/tiny11maker.ps1 +++ b/tiny11maker.ps1 @@ -99,7 +99,9 @@ if (! $myWindowsPrincipal.IsInRole($adminRole)) exit } - +if (-not (Test-Path -Path "$PSScriptRoot/autounattend.xml")) { + Invoke-RestMethod "https://raw.githubusercontent.com/ntdevlabs/tiny11builder/refs/heads/main/autounattend.xml" -OutFile "$PSScriptRoot/autounattend.xml" +} # Start the transcript and prepare the window Start-Transcript -Path "$ScratchDisk\tiny11.log"