I also got this error The term ‘Get-AzureRmResource’ 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.
while executing the below cmdlet
$myVmName = 'MyNewVM'
$myrsgName = 'newresgroup'
$myvm = Get-AzureRmVM –Name $myVmName –ResourceGroupName $myrsgName
$myResource = @{
'ResourceName' = $myVmName
'ResourceType' = 'Microsoft.Compute/virtualMachines'
'ResourceGroupName' = $myrsgName
}
$myvmResource = Get-AzureRmResource @myResource
$myvmId = $vmResource.Properties.VmId
You can see here

The exact error is
Get-AzureRmResource: The term ‘Get-AzureRmResource’ 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:12 char:18
- $myvmResource = Get-AzureRmResource @myResource
~~~~~~~- CategoryInfo : ObjectNotFound: (Get-AzureRmResource: String) [], CommandNotFoundException
- FullyQualifiedErrorId: CommandNotFoundException
The term ‘Get-AzureRmResource’ is not recognized as the name of a cmdlet [Solved]
To fix this error, follow the same steps as above.
Login to the AzureRm Account using the below command.
PS C:\windows\system32> Login-AzureRmAccount
Next, install the AzureRm module using the below cmdlet
PS C:\windows\system32> Install-Module AzureRm
Click on the Yes button from the below pop-up

Now you can see below it started installing the AzureRm module.

It should fix the issue now, but in case you get the error “No match was found for the specified search criteria and module name AzureRm”. You can follow my article. No match was found for the specified search criteria and module name ‘AzureAD’ to fix this error.

I am Rajkishore, and I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machine, 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.