PowerShell Signing Scripts Bypassing execution policy for a single script


Example

Often you might need to execute an unsigned script that doesn't comply with the current execution policy. An easy way to do this is by bypassing the execution policy for that single process. Example:

powershell.exe -ExecutionPolicy Bypass -File C:\MyUnsignedScript.ps1

Or you can use the shorthand:

powershell -ep Bypass C:\MyUnsignedScript.ps1

Other Execution Policies:

PolicyDescription
AllSignedOnly scripts signed by a trusted publisher can be run.
BypassNo restrictions; all Windows PowerShell scripts can be run.
DefaultNormally RemoteSigned, but is controlled via ActiveDirectory
RemoteSignedDownloaded scripts must be signed by a trusted publisher before they can be run.
RestrictedNo scripts can be run. Windows PowerShell can be used only in interactive mode.
UndefinedNA
Unrestricted*Similar to bypass

Unrestricted* Caveat: If you run an unsigned script that was downloaded from the Internet, you are prompted for permission before it runs.


More Information available here.