From 768c476b4d3e19644eaf14c0936690521881aa0a Mon Sep 17 00:00:00 2001 From: Old Character <167513064+Miiraak@users.noreply.github.com> Date: Tue, 4 Nov 2025 20:07:19 +0100 Subject: [PATCH 1/2] Adminstrator-running-fallback-patch A few months ago, in the readme, we changed the `Set-Execution` policy to a process scoped one to avoid users exposing their machine. That induces a new problem. When we start the script without administrator rights, but with the `Set-Executionpolicy` scoped to `Process`, the script restarts itself with elevated rights but in the previously set execution policy (likely `RemoteSigned`). This patch passes : - NoProfile - ExecutionPolicy Bypass - NoExit - File To the newly created process. --- tiny11Coremaker.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tiny11Coremaker.ps1 b/tiny11Coremaker.ps1 index 439768a..d78ea76 100644 --- a/tiny11Coremaker.ps1 +++ b/tiny11Coremaker.ps1 @@ -19,7 +19,7 @@ if (! $myWindowsPrincipal.IsInRole($adminRole)) { Write-Host "Restarting Tiny11 image creator as admin in a new window, you can close this one." $newProcess = new-object System.Diagnostics.ProcessStartInfo "PowerShell"; - $newProcess.Arguments = $myInvocation.MyCommand.Definition; + $newProcess.Arguments = "-NoProfile -ExecutionPolicy Bypass -NoExit -File `"$($myInvocation.MyCommand.Definition)`""; $newProcess.Verb = "runas"; [System.Diagnostics.Process]::Start($newProcess); exit @@ -577,3 +577,4 @@ elseif ($input -eq 'n') { else { Write-Host "Invalid input. Please enter 'y' to continue or 'n' to exit." } + From c29e24df5da9326535c2646c14b348a3a0423cc5 Mon Sep 17 00:00:00 2001 From: Old Character <167513064+Miiraak@users.noreply.github.com> Date: Tue, 4 Nov 2025 20:08:02 +0100 Subject: [PATCH 2/2] Adminstrator-running-fallback-patch A few months ago, in the readme, we changed the `Set-Execution` policy to a process scoped one to avoid users exposing their machine. That induces a new problem. When we start the script without administrator rights, but with the `Set-Executionpolicy` scoped to `Process`, the script restarts itself with elevated rights but in the previously set execution policy (likely `RemoteSigned`). This patch passes : - NoProfile - ExecutionPolicy Bypass - NoExit - File To the newly created process. --- tiny11maker.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tiny11maker.ps1 b/tiny11maker.ps1 index c24757f..b4e96ea 100644 --- a/tiny11maker.ps1 +++ b/tiny11maker.ps1 @@ -90,7 +90,7 @@ if (! $myWindowsPrincipal.IsInRole($adminRole)) { Write-Output "Restarting Tiny11 image creator as admin in a new window, you can close this one." $newProcess = new-object System.Diagnostics.ProcessStartInfo "PowerShell"; - $newProcess.Arguments = $myInvocation.MyCommand.Definition; + $newProcess.Arguments = "-NoProfile -ExecutionPolicy Bypass -NoExit -File `"$($myInvocation.MyCommand.Definition)`""; $newProcess.Verb = "runas"; [System.Diagnostics.Process]::Start($newProcess); exit @@ -533,3 +533,4 @@ Stop-Transcript exit +