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.
- The term ‘connect-azuread’ is not recognized as the name of a cmdlet function Azure
- The term ‘get-aduser’ is not recognized as the name of a cmdlet in Windows 10 PowerShell
- Unable to find package providers (NuGet)
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

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

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

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.

You may like following Azure tutorials:
- How to Connect to Azure in PowerShell (And Azure AD)
- How to create a user in Azure active directory
- How to add bulk guest users in Azure AD B2B from Azure Portal and PowerShell
- What is Azure Active Directory B2B collaboration (Azure AD B2B)
- The term ‘get-aduser’ is not recognized as the name of a cmdlet in Windows 10 PowerShell
- The term ‘connect-azuread’ is not recognized as the name of a cmdlet function Azure
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.