Powershell error – Az.Resources.psm1 cannot be loaded because running scripts is disabled on this system

In this azure tutorial, we will discuss how to fix the error, Az.Resources.psm1 cannot be loaded because running scripts is disabled on this system which comes while trying to import the Module Az. Resources using PowerShell.

Powershell error – Az.Resources.psm1 cannot be loaded because running scripts is disabled on this system

Recently, I was trying to import the module Az.Resources, I got the below error.

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

I was running the below line of command/script in my Powershell window

Import-Module Az.Resources

I got the error as below. The complete error message is as below

Import-Module : File C:\Program Files (x86)\WindowsPowerShell\Modules\Az.Resources\1.13.0\Az.Resources.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:1 char:1

  • Import-Module Az.Resources
  • ~~~~~~
    • CategoryInfo : SecurityError: (:) [Import-Module], PSSecurityException
    • FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand
Az.Resources.psm1 cannot be loaded because running scripts is disabled on this system

The above error means that the Az.Resources.psm1 module downloaded from the internet and that must be signed by a trusted publisher before you can run it.

Now to fix this error, You need to follow the below steps

Step- 1:

Run the below command which will change the execution policy

Set-ExecutionPolicy RemoteSigned

You can see here

ExecutionPolicy RemoteSigned

Step- 2:

It will throw a popup to confirm to change the Execution policy, you can choose “Yes”. See below.

how to import the Module Az. Resources in powershell

Step- 3:

Now you can run the below command to import the Module Az. Resources.You can run the below command.

Import-Module Az.Resources

This time it will import the module successfully with out any error.

how to import the Module Az. Resources

You may like following Azure tutorials:

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