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." } + 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 +