• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

TECHDIIP

  • Tech
  • Windows
  • Powershell
  • Scripts
  • News
  • Games

PowerShell Error Execution Of Scripts Is Disabled On This System | Solution

How To Enable Powershell Execution Policy on any windows computer for Powershell scripts to work as expected, here are the steps to how to do it.

When you run a PowerShell script and if it says “execution of scripts is disabled on this system”, what does it mean? It means the execution policy is set as restricted, let’s learn what are execution policies and how to set them for use.

Restricted

No Script either local, remote or downloaded can be executed on the system.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

AllSigned

All scripts that run require to be digitally signed.

Set-ExecutionPolicy -ExecutionPolicy Allsigned

RemoteSigned

All remote scripts (UNC) or downloaded need to be signed.

Set-ExecutionPolicy -ExecutionPolicy Remotesigned

 Unrestricted

No signature for any type of script is required.

Set-ExecutionPolicy -ExecutionPolicy Unrestricted

Scope of new Change

LocalMachine  

The execution policy affects all users of the computer.

 CurrentUser 

The execution policy affects only the current user.

Process

The execution policy affects only the current Windows PowerShell process, to check your current execution policy, you can run Get-ExecutionPolicy and get the current policy.

Get-ExecutionPolicy

Resolution

  1. Go to Start Menu and search for “Windows PowerShell ISE”.
  2. Right click the x86 version and choose “Run as administrator”
  3. Open PowerShell as Administrator and run Set-ExecutionPolicy -Scope CurrentUser
  4. Provide RemoteSigned and press Enter
  5. Run Set-ExecutionPolicy -Scope CurrentUser
  6.  Provide Unrestricted and press Enter

Conclusion:

By default it is Restricted. To change the execution of PowerShell scripts we need to set this ExecutionPolicy either as Bypass or Unrestricted.

We can set the policy for Current User as Bypass or Unrestricted by using any of the below PowerShell commands:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass -Force;

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force;

Thank you for reading this article, if you have any questions please let us know.

Thank you for visiting my site, please make sure you have tested this script in our lower environment before you run in production.

Reader Interactions

Leave a Reply Cancel reply

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

Primary Sidebar

Recent Posts

  • How do Zoom Application Testing | Working or Not
  • Powershell script to test website status up or down on a local or remote computers
  • Solved: Server execution failed windows 10 Server 2016 and 2019
  • How to Fix windows 10 version 1903 error 0xc1900223
  • Free Music Making Software List One Can Try Out
  • About Us
  • CONTACT US
  • Disclaimer
  • Privacy Policy

Copyright © 2023 techdiip.com