In this article, we will discuss how to fix the error “The ‘Get-AzResourceGroup’ command was found in the module ‘Az.Resources’, but the module could not be loaded” that I got while trying to execute the Get-AzResourceGroup Azure PowerShell cmdlet to retrieve the list of Azure Resource Groups.
Table of Contents
The ‘Get-AzResourceGroup’ command was found in the module ‘Az.Resources’, but the module could not be loaded
Recently, I was required to retrieve all the Resource Groups using Azure PowerShell. So I have executed the Get-AzResourceGroup Azure PowerShell cmdlet.
The moment I executed the Get-AzResourceGroup Azure PowerShell cmdlet, I got the following error.
“The ‘Get-AzResourceGroup’ command was found in the module ‘Az.Resources’, but the module could not be loaded“
The complete error message was as below
Get-AzResourceGroup : The 'Get-AzResourceGroup' command was found in the module
'Az.Resources', but the module could not be loaded. For more information, run
'Import-Module Az.Resources'.
At line:1 char:1
+ Get-AzResourceGroup -Location westus2 |
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-AzResourceGroup:String) [], Comman
dNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
You can see the same error here

Now, let’s find out the way to fix this issue.
Solution
Now, to fix this issue, we need to import the Az.Resources module, we can run the Get-AzResourceGroup Azure PowerShell cmdlet.
Note: If you are getting any errors while importing the Az.Resources, try opening a new PowerShell session and run the import cmdlet.
Run the following Azure PowerShell command to import Az.Resources module.
Import-Module -Name Az.ResourcesThen, you can run the Get-AzResourceGroup Azure PowerShell cmdlet.
Get-AzResourceGroupOr, you can execute the Azure PowerShell cmdlet as below.
Import-Module -Name Az.Resources
Get-AzResourceGroupOnce I executed the Azure PowerShell cmdlet, I got the expected output below.

Voila! How easy to fix the issue The ‘Get-AzResourceGroup’ command was found in the module ‘Az.Resources’. Now, it’s your turn to fix the same issue following the above instructions.
You may also like the following articles below.
- New-AzResourceGroup: A positional parameter cannot be found that accepts an argument
- The term ‘New-AzResourceGroup’ is not recognized as the name of a cmdlet
- New-AzureRmResourceGroup: ‘this.Client.SubscriptionId’ cannot be null
- Get-AzResource

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
