Azure.psm1 cannot be loaded because running scripts is disabled on this system

In this azure tutorial, we will discuss how to fix the error, 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. Azure.psm1 cannot be loaded because running scripts is disabled on this system.

Which comes while trying to execute the cmdlet to import the Azure module using  PowerShell ISE in Azure.

Azure.psm1 cannot be loaded because running scripts is disabled on this system

Recently, while executing the below cmdlet to import the Azure module, i got the above error.

PS C:\windows\system32> Import-Module Azure
Azure.psm1 cannot be loaded because running scripts is disabled on this system.

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

To fix the above issue run the below command first.

PS C:\windows\system32> Set-ExecutionPolicy RemoteSigned
Azure.psm1 cannot be loaded because running scripts is disabled on this system

After running the above command, again try importing the Azure Module using the below cmdlet in your PowerShell window or PowerShell ISE. Now you can able to see it imported the Azure module sucessfully.

PS C:\windows\system32> Import-Module Azure
cannot be loaded because running scripts is disabled on this system

You may like following Azure tutorials:

In this Azure tutorial, we discussed how to fix error, Azure.psm1 cannot be loaded because running scripts is disabled on this system. I hope it helped you to fix your issue.

Leave a Comment