mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-15 17:30:37 -06:00
last fix
This commit is contained in:
parent
da173cc720
commit
5468b86898
@ -47,22 +47,10 @@ $sync.ProcessRunning = $false
|
||||
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."
|
||||
|
||||
$script = if (Test-Path "$PSScriptRoot\winutil.ps1") {
|
||||
"$PSScriptRoot\winutil.ps1"
|
||||
} else {
|
||||
"irm christitus.com/win | iex"
|
||||
}
|
||||
$powershellcmd = if (Get-Command pwsh -ErrorAction SilentlyContinue) {
|
||||
"pwsh.exe"
|
||||
} else {
|
||||
"powershell.exe"
|
||||
}
|
||||
$script = if ($MyInvocation.MyCommand.Path) { "& '" + $MyInvocation.MyCommand.Path + "'" } else { "irm 'https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1' | iex"}
|
||||
$powershellcmd = if (Get-Command pwsh -ErrorAction SilentlyContinue) { "pwsh" } else { "powershell" }
|
||||
$processCmd = if (Get-Command wt.exe -ErrorAction SilentlyContinue) { "wt.exe" } else { $powershellcmd }
|
||||
|
||||
$processCmd = if (Get-Command wt.exe -ErrorAction SilentlyContinue) {
|
||||
"wt.exe"
|
||||
} else {
|
||||
$powershellcmd
|
||||
}
|
||||
Start-Process $processCmd -ArgumentList "$powershellcmd -ExecutionPolicy Bypass -NoProfile -Command $script" -Verb RunAs
|
||||
|
||||
break
|
||||
|
15
windev.ps1
15
windev.ps1
@ -15,19 +15,10 @@
|
||||
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."
|
||||
|
||||
$script = "irm christitus.com/windev | iex"
|
||||
$script = if (!$MyInvocation.MyCommand.Path) { "& '" + $MyInvocation.MyCommand.Path + "'" } else { "irm 'https://github.com/ChrisTitusTech/winutil/raw/main/windev.ps1' | iex"}
|
||||
$powershellcmd = if (Get-Command pwsh -ErrorAction SilentlyContinue) { "pwsh" } else { "powershell" }
|
||||
$processCmd = if (Get-Command wt.exe -ErrorAction SilentlyContinue) { "wt.exe" } else { $powershellcmd }
|
||||
|
||||
$powershellcmd = if (Get-Command pwsh -ErrorAction SilentlyContinue) {
|
||||
"pwsh.exe"
|
||||
} else {
|
||||
"powershell.exe"
|
||||
}
|
||||
|
||||
$processCmd = if (Get-Command wt.exe -ErrorAction SilentlyContinue) {
|
||||
"wt.exe"
|
||||
} else {
|
||||
$powershellcmd
|
||||
}
|
||||
Start-Process $processCmd -ArgumentList "$powershellcmd -ExecutionPolicy Bypass -NoProfile -Command $script" -Verb RunAs
|
||||
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user