mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-15 09:20:36 -06:00
compat fixes
This commit is contained in:
parent
de3657adfa
commit
8bde2f3be3
@ -85,7 +85,9 @@ param(
|
||||
|
||||
$url = if (-not $Preview) {
|
||||
# This must be pointing to the latest stable release (Chris-Hosted)
|
||||
"https://christitus.com/win/stable"
|
||||
# FIXME: change me to the below url and host me here
|
||||
"https://christitus.com/win"
|
||||
# "https://christitus.com/win/stable"
|
||||
} else {
|
||||
# This must be pointing to the latest pre-release or the release (GitHub releases)
|
||||
Get-Latest-PreRelease-Url
|
||||
|
@ -16,8 +16,10 @@ param (
|
||||
|
||||
# Run as administrator if not already (only for script on disk, not in memory)
|
||||
if (-not ([Security.Principal.WindowsPrincipal]([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
||||
$MyScriptPath = $MyInvocation.PSCommandPath
|
||||
|
||||
# If script not on disk, show error message and quit
|
||||
if (-not $MyInvocation.MyCommand.Source) {
|
||||
if (-not $MyScriptPath) {
|
||||
Write-Host "===========================================" -Foregroundcolor Red
|
||||
Write-Host "-- Scripts must be run as Administrator ---" -Foregroundcolor Red
|
||||
Write-Host "-- Right-Click Start -> Terminal(Admin) ---" -Foregroundcolor Red
|
||||
@ -37,7 +39,7 @@ param (
|
||||
$PwshArgList = @(
|
||||
"-NoLogo", # Don't print PowerShell header in CLI
|
||||
"-NoProfile", # Don't load PowerShell profile
|
||||
"-File", $MyInvocation.MyCommand.Source, # Script path
|
||||
"-File", $MyScriptPath, # Script path
|
||||
$args | ForEach-Object { $_ } # Script arguments
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user