Error: The term ‘Save-AzureRMProfile’ is not recognized as the name of a cmdlet, function, script file, or operable program

If you have recently installed Azure PowerShell module on one of the machines and then trying to login using Select-AzureRMProfile, you are likely to receive below error:

Save-AzureRMProfile : The term ‘Save-AzureRMProfile’ 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 againAt line:3 char:2+  Save-AzureRMProfile -Path “C:\$SubscriptionName.json”+  ~~~~~~~~~~~~~~~~~~~    + CategoryInfo          : ObjectNotFound: (Save-AzureRMProfile:String) [], CommandNotFoundException    + FullyQualifiedErrorId : CommandNotFoundException

I checked the list of cmdlets and it was gone. I checked the docs, and it does include a listing for Save-AzureRmProfile.

https://docs.microsoft.com/en-us/powershell/module/azurerm.profile/save-azurermprofile?view=azurermps-3.8.0

This is a case of the PowerShell AzureRM module getting ahead of the docs and one more botched up documentation for Azure PowerShell. After spending some time, I found that the cmdlets had been replaced with the new noun of AzureRmContext.

To use them, first login to Azure manually using Login-AzureRmAccount. Then, use the new Save-AzureRmContext to save your information to a file.


# Setup – First login manually using login-azurermaccount
# Now save your context locally
$path = "C:\Azure\PS\ProfileContext.json’
Save-AzureRmContext -Path $path -Force

Once that’s done, from then on you can use the Import-AzureRmContext to automate the login.


$path = C:\Azure\PS\ProfileContext.json’
Import-AzureRmContext -Path $path

There are other undocumented changes too. We will discover that in later posts.

One thought on “Error: The term ‘Save-AzureRMProfile’ is not recognized as the name of a cmdlet, function, script file, or operable program

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s