# Sometimes works from cmd: powershell -Version 2 # PowerShell 2 might not be subject to same CLM rules

PowerShell can be "blocked" in several ways: execution policy, AppLocker, Device Guard, antivirus, or Group Policy. This guide covers each layer. 1. Identify the Type of Block First, determine how PowerShell is blocked.

gpupdate /force If all else fails, run PowerShell in memory without invoking powershell.exe: Via WMI: wmic process call create "powershell -EncodedCommand <base64 command>" Via VBA / Office macros: CreateObject("WScript.Shell").Run "powershell -ExecutionPolicy Bypass -WindowStyle Hidden -Command ""...""", 0, False Via scheduled task (bypass many restrictions): schtasks /create /tn "TempTask" /tr "powershell -Command '...'" /sc once /st 00:00 /f schtasks /run /tn "TempTask" 8. Recovery When Completely Locked Out If you have physical or remote desktop access:

| Symptom | Likely Cause | |---------|---------------| | ...cannot be loaded because running scripts is disabled... | Execution Policy | | This program is blocked by group policy | AppLocker / SRP | | PowerShell opens then immediately closes | Constrained Language Mode or antivirus | | Access denied when running as admin | UAC or token restriction |

# List active policies citool -lp Mount-VHD -Path C:\EFI\Microsoft\Boot\SecureBoot.efi -NoDriveLetter Or use: SiPolicy.p7b removal from EFI partition

How To Unblock Powershell -

# Sometimes works from cmd: powershell -Version 2 # PowerShell 2 might not be subject to same CLM rules

PowerShell can be "blocked" in several ways: execution policy, AppLocker, Device Guard, antivirus, or Group Policy. This guide covers each layer. 1. Identify the Type of Block First, determine how PowerShell is blocked. how to unblock powershell

gpupdate /force If all else fails, run PowerShell in memory without invoking powershell.exe: Via WMI: wmic process call create "powershell -EncodedCommand <base64 command>" Via VBA / Office macros: CreateObject("WScript.Shell").Run "powershell -ExecutionPolicy Bypass -WindowStyle Hidden -Command ""...""", 0, False Via scheduled task (bypass many restrictions): schtasks /create /tn "TempTask" /tr "powershell -Command '...'" /sc once /st 00:00 /f schtasks /run /tn "TempTask" 8. Recovery When Completely Locked Out If you have physical or remote desktop access: # Sometimes works from cmd: powershell -Version 2

| Symptom | Likely Cause | |---------|---------------| | ...cannot be loaded because running scripts is disabled... | Execution Policy | | This program is blocked by group policy | AppLocker / SRP | | PowerShell opens then immediately closes | Constrained Language Mode or antivirus | | Access denied when running as admin | UAC or token restriction | Identify the Type of Block First, determine how

# List active policies citool -lp Mount-VHD -Path C:\EFI\Microsoft\Boot\SecureBoot.efi -NoDriveLetter Or use: SiPolicy.p7b removal from EFI partition