Skip to content

Silently bypass execution policy when running a PowerShell script

When running a PowerShell script, you might sometimes encounter systems where the execution policy prevents the script from running.

A quick workaround is to use a batch script to call the PowerShell script. This also allows you to create a desktop shortcut, which is useful if it’s a script you run frequently.

PowerShell lets you bypass the execution policy, so what the batch script essentially does is start PowerShell with the -ExecutionPolicy Bypass parameter and run the script — plain and simple.

To get started, either download the script or copy the one below, paste it into your favorite text editor, and save it as a batch file (.bat). All you need to do is update the quoted path to point to your PowerShell script.

@echo off

PowerShell -NoProfile -ExecutionPolicy Bypass -File "C:\Scripts\PowerShell\YourScriptFile.ps1"

Leave a Reply

Your email address will not be published. Required fields are marked *