From a6d4d47a88fe3163b5362fa0f270234e6b1a73a0 Mon Sep 17 00:00:00 2001 From: MyDrift Date: Wed, 21 Aug 2024 21:48:27 +0200 Subject: [PATCH] add proper method to launch correct script --- scripts/start.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/start.ps1 b/scripts/start.ps1 index 443b7b15..00c4665e 100644 --- a/scripts/start.ps1 +++ b/scripts/start.ps1 @@ -48,17 +48,17 @@ if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]: Write-Output "Winutil needs to be run as Administrator. Attempting to relaunch." $wtInstalled = Get-Command wt.exe -ErrorAction SilentlyContinue - $pwshInstalled = Get-Command pwsh -ErrorAction SilentlyContinue + $pwshInstalled = Get-Command pwsh -ErrorAction SilentlyContinue if ($pwshInstalled) { $powershellcmd = "pwsh" } else { $powershellcmd = "powershell" } - + if ($wtInstalled) { - Start-Process wt.exe -ArgumentList "new-tab $powershellcmd -ExecutionPolicy Bypass -Command `"irm https://christitus.com/win | iex`"" -Verb RunAs + Start-Process wt.exe -ArgumentList "$powershellcmd -ExecutionPolicy Bypass -NoProfile -File $PSScriptRoot\winutil.ps1 -Run" -Verb RunAs } else { - Start-Process $powershellcmd -ArgumentList "-ExecutionPolicy Bypass -Command `"irm https://christitus.com/win | iex`"" -Verb RunAs + Start-Process $powershellcmd -ArgumentList "-ExecutionPolicy Bypass -NoProfile -File $PSScriptRoot\\winutil.ps1 -Run" -Verb RunAs } break @@ -66,4 +66,4 @@ if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]: # Set PowerShell window title $Host.UI.RawUI.WindowTitle = $myInvocation.MyCommand.Definition + "(Admin)" -clear-host \ No newline at end of file +clear-host