Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get-AzureRmResourceGroup : The term 'Get-AzureRmResourceGroup' is not recognized as the name of a cmdlet

I'm trying to retrieve a resource group name from my Azure subscription in PowerShell:

Get-AzureRmResourceGroup | select resourcegroupname

But I get the following error:

Get-AzureRmResourceGroup : The term 'Get-AzureRmResourceGroup' 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
+ Get-AzureRmResourceGroup | select resourcegroupname
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-AzureRmResourceGroup:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I have PowerShell 5.0 and have imported the latest Azure module. Why is this not included?

like image 782
Martin Erlic Avatar asked Jan 11 '17 13:01

Martin Erlic


2 Answers

You need to get the Azure RM module installed first by using the following command:

Install-Module AzureRM 

Then you need to import the module for use:

Import-Module AzureRM
like image 110
user1894814 Avatar answered Oct 26 '22 21:10

user1894814


I was missing the AzureRM dependency so I had to run the following command: Install-AzureRM. Afterwards, Get-AzureRmResourceGroup | select resourcegroupname executed successfully.

like image 4
Martin Erlic Avatar answered Oct 26 '22 23:10

Martin Erlic