From d3ef94f175b8d27b90be8fc98e9cf04b6fdf341a Mon Sep 17 00:00:00 2001 From: Chris Titus Tech Date: Tue, 10 Sep 2024 14:18:51 -0500 Subject: [PATCH] Update windev.ps1 --- windev.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/windev.ps1 b/windev.ps1 index 2e48ab4f..9668d2a7 100644 --- a/windev.ps1 +++ b/windev.ps1 @@ -34,15 +34,15 @@ function RedirectToLatestPreRelease { Write-Host "Using latest Full Release" $url = "https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1" } - - $script = Invoke-RestMethod $url - # Elevate Shell if necessary + + $script = Invoke-RestMethod $url + # Elevate Shell if necessary if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { Write-Output "Winutil needs to be run as Administrator. Attempting to relaunch." $powershellcmd = if (Get-Command pwsh -ErrorAction SilentlyContinue) { "pwsh" } else { "powershell" } $processCmd = if (Get-Command wt.exe -ErrorAction SilentlyContinue) { "wt.exe" } else { $powershellcmd } - + Start-Process $processCmd -ArgumentList "$powershellcmd -ExecutionPolicy Bypass -NoProfile -Command $(Invoke-Expression $script)" -Verb RunAs } else{