Cannot be loaded because running scripts is disabled on this system

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.

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
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

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
unauthorizedaccess,microsoft.powershell.commands.importmodulecommand

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
fullyqualifiederrorid : unauthorizedaccess,microsoft.powershell.commands.importmodulecommand

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.