In this Azure tutorial, we will discuss how to fix the error cannot be loaded because running scripts is disabled on this system. For more information, Which comes while trying to execute the cmdlet to import the Azure module using PowerShell ISE in Azure.
Table of Contents
Cannot be loaded because running scripts is disabled on this system
I got the above error while executing the below PowerShell cmdlet to import the Azure module.
PS C:\windows\system32> Import-Module Azure
The complete error message is as below
files cannot be loaded because running scripts is disabled
Import-Module: File C:\Program Files\WindowsPowerShell\Modules\Azure\5.3.0\Azure.psm1 cannot be loaded because running scripts is disabled on this system. For more information,
see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:5 char:1
- Import-Module Azure
~~~~~~~- CategoryInfo : SecurityError: (:) [Import-Module], PSSecurityException
- FullyQualifiedErrorId: UnauthorizedAccess, Microsoft.PowerShell.Commands.ImportModuleCommand
Running scripts is disabled on this system [Solved]
To fix the above issue, Follow the below 2 simple steps.
1. Run the below command first. Execute the below PowerShell command.
PS C:\windows\system32> Set-ExecutionPolicy RemoteSigned
2. After running the above command, try importing the Azure Module using the below cmdlet in your PowerShell window or PowerShell ISE. Now you can see it imported the Azure module successfully. You can check out the screenshot below.
PS C:\windows\system32> Import-Module Azure
You may like the following Azure tutorials:
In this Azure tutorial, we discussed how to fix the error, cannot be loaded because running scripts is disabled on this system. I hope it helped you to fix your issue.
I am Bijay, a Microsoft MVP (10 times) having more than 17 years of experience in the software industry. During my IT career, I got a chance to share my expertise in SharePoint and Microsoft Azure, like Azure VM, Azure Active Directory, Azure PowerShell, etc. I hope you will learn from these Azure tutorials. Read more