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

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

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

Step-2: Now click on the Yes button from the below popup.

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

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

Step-4: Once the installation will 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 maximum chance you will get 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 following Azure tutorial:

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.