Files
winutil/scripts/start.ps1
T

27 lines
860 B
PowerShell
Raw Normal View History

+3
2023-03-07 12:28:00 -08:00
<#
.NOTES
Author : Chris Titus @christitustech
Runspace Author: @DeveloperDurp
GitHub : https://github.com/ChrisTitusTech
Version : #{replaceme}
#>
Start-Transcript $ENV:TEMP\Winutil.log -Append
#Load DLLs
Add-Type -AssemblyName System.Windows.Forms
# variable to sync between runspaces
$sync = [Hashtable]::Synchronized(@{})
$sync.PSScriptRoot = $PSScriptRoot
$sync.version = "#{replaceme}"
$sync.configs = @{}
$sync.ProcessRunning = $false
2023-07-13 15:46:00 -05:00
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
2023-08-02 19:43:52 -05:00
Write-Output "Winutil needs to be run as Administrator. Attempting to relaunch."
2023-07-13 15:46:00 -05:00
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "iwr -useb https://christitus.com/win | iex"
break
}