Kenny_I
Kenny_I

Reputation: 2503

LogicApps on VS2019 says "The term 'Get-AzureRmResourceGroup' is not recognized"

How to fix my problem without removing Az?

I have removed RM and installed Az. I have LogicApps on VS2019 (16.6.5) and trying to deploy.

I get error:

"The term 'Get-AzureRmResourceGroup' is not recognized as the name of a cmdlet, function, script file..."

I next tried to re-install RM by PS C:\WINDOWS\system32> Install-Module AzureRM

ackageManagement\Install-Package : The following commands are already available on this syste
m:'Login-AzAccount,Logout-AzAccount,Resolve-Error,Send-Feedback'. This module 'AzureRM.profile
' may override the existing commands. If you still want to install this module 'AzureRM.profil
e', use -AllowClobber parameter.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (Microsoft.Power....InstallPackage:InstallPac 
kage) [Install-Package], Exception
+ FullyQualifiedErrorId : CommandAlreadyAvailable,Validate-ModuleCommandAlreadyAvailable, 
Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

Upvotes: 1

Views: 518

Answers (1)

MayankBargali
MayankBargali

Reputation: 750

Az and AzureRM cannot be imported side-by-side into the same PowerShell session. If you do not want to migrate your scripts from AzureRM to Az right away, there are two main options:

Install Az in PowerShell Core, and leave AzureRM in Windows PowerShell Install Az and AzureRM side-by-side in Windows PowerShell and ensure scripts do not mix the modules

Details steps are documented here

Reference: https://learn.microsoft.com/en-us/powershell/azure/migrate-from-azurerm-to-az

Upvotes: 2

Related Questions