From 296203445d199cf04200cdbc94b0fd7c4781cff6 Mon Sep 17 00:00:00 2001 From: OlaYZen Date: Tue, 11 Oct 2022 09:17:40 +0200 Subject: [PATCH] ADMIN FIX 2 --- EnhanceWindows.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EnhanceWindows.ps1 b/EnhanceWindows.ps1 index 1daa040..9d5dc4e 100644 --- a/EnhanceWindows.ps1 +++ b/EnhanceWindows.ps1 @@ -1,8 +1,8 @@ #======================================================== # Starts Powershell with the Modules and as hidden #======================================================== -if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit } -Powershell-Cmdlet -Confirm:$false +ECHO 'Y' | if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit } + [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") [void] [System.Reflection.Assembly]::LoadWithPartialName("PresentationFramework")