The term ‘New-AzResourceGroup’ is not recognized as the name of a cmdlet

In this Azure tutorial, we will discuss how to fix the error. The term ‘New-AzResourceGroup’ is not recognized as the name of a cmdlet, which comes while trying to create a resource group using PowerShell in Azure.

The term ‘New-AzResourceGroup’ is not recognized as the name of a cmdlet

Recently, while trying to execute the below line of cmdlet, I got the above error.

PS C:\windows\system32> New-AzResourceGroup -Name myResourceGroup -Location centralUS
The term 'New-AzResourceGroup' is not recognized as the name of a cmdlet

The exact error message was

New-AzResourceGroup: The term ‘New-AzResourceGroup’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.

At line:1 char:1

  • New-AzResourceGroup -Name myResourceGroup -Location centralUS
  • ~~~~~~~
    • CategoryInfo : ObjectNotFound: (New-AzResourceGroup:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

The term ‘New-AzResourceGroup’ is not recognized as the name of a cmdlet [Solved]

To fix this error, you need to follow the below steps

1. Install the Az module using the below cmdlet.

PS C:\windows\system32> Install-Module -Name Az -AllowClobber
the term 'new-azresourcegroup' is not recognized

2. Now click on the Yes button from the below popup.

the term 'get-azresourcegroup' is not recognized as the name of a cmdlet

3. Now, you can see the installation of the Az module is in progress.

the term 'new-azureresourcegroup' is not recognized as the name of a cmdlet function

4. Once the installation is complete, try executing the below cmdlet again to install the Az module.

PS C:\windows\system32> Install-Module -Name Az -AllowClobber
the term 'new-azureresourcegroup' is not recognized as the name of a cmdlet

After executing the above code, there is a maximum chance of getting the below error.

New-AzResourceGroup: The ‘New-AzResourceGroup’ command was found in the module ‘Az.Resources’, but the module could not be loaded. For more information, run ‘Import-Module Az.Resources’.

new-azresourcegroup

Now, to fix the above error, You can follow my article. The ‘New-AzResourceGroup’ command was found in the module ‘Az.Resources’

You may like the following Azure tutorial:

Conclusion

In this tutorial, we discussed how to fix the error. The term ‘New-AzResourceGroup’ is not recognized as the name of a cmdlet. I hope it helped you to fix your issue.