In this tutorial, we will see How to Enable PowerShell Script on Windows. By Default Powershell Script is disabled in windows. Don’t worry we can fix it in an easy way.
PowerShell or Microsoft PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language.
From 2006 to 2016, PowerShell was only available on Windows, named Windows PowerShell up to version 5.1. PowerShell was built on top of the .NET Framework, which was only available in Windows. In 2016, Microsoft decided to make a bold move and open-source PowerShell on GitHub, where it dropped the ‘Windows’ and went to just ‘PowerShell’ in version six.
How to Enable PowerShell Script on Windows
if Powershell Script is disable and you want to run any script then you will see some errors like this:
Cannot be loaded because the execution of scripts is disabled on this system. Please see “get-help about-signing”.
So let’s go to fix it
first, let’s check whether Powershell Script is disable by the system or not.
Error Check :
- Press Windows+R to open the Run dialog box.
- Now type “PowerShell” in the text box and hit Enter.
- It will Open PowerShell Console.
- Now type “Get-Executionpolicy” and hit Enter.
- Now just type
set-executionpolicy remotesignedand hit Enter.
- That will tell PowerShell to allow local (that is, on a local drive) unsigned scripts to run.
- Then try executing your script again. it will fix your issue.