From 95208a8d969911c26b6662b016227190e7d502de Mon Sep 17 00:00:00 2001 From: pplude Date: Tue, 8 Sep 2015 16:07:26 -0400 Subject: [PATCH] Added another Popup Added popup to notify if not running as admin --- Core.ps1 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Core.ps1 b/Core.ps1 index 97f1f2c..1257747 100644 --- a/Core.ps1 +++ b/Core.ps1 @@ -56,9 +56,7 @@ $SafeMode = (Get-WmiObject Win32_ComputerSystem | Select-Object BootupState | fo # This will test to see if the user is admin, and terminate the script if it fails the user rights check If (!([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { - Write-Host "User is not running as administrator. `n `n Please run this script through an Administrative Powershell. `n" - Write-Host "Press any key to continue..." - $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown') + [System.Windows.Forms.MessageBox]::Show("User is not running as administrator. `n `n Please run this script through an Administrative Powershell.", "ERROR") | Out-Null [Environment]::Exit(6) } @@ -115,7 +113,7 @@ If ($SafeMode -eq "Normal Boot") If ($SafeMode -eq "Fail-safe boot") { - [System.Windows.Forms.MessageBox]::Show("The system is in Safe Mode without Network support. Tron:Evo does not function in this mode. Please boot into Windows normally or using the Safe Mode with Networking option." , "WARNING") | Out-Null + [System.Windows.Forms.MessageBox]::Show("The system is in Safe Mode without Network support. Tron:Evo does not function in this mode. Please boot into Windows normally or using the Safe Mode with Networking option." , "ERROR") | Out-Null [Environment]::Exit(4) }