2

I was getting below error

The term 'New-AzureRmServiceBusNamespace' is not recognized as the name of a cmdlet, function, script file, or operable program.

If i try to run Import-Module AzureRM.ServiceBus I get below error

The member 'FormatsToProcess' in the module manifest is not valid: Cannot find path 'C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\AzureRM.ServiceBus.\Microsoft.Azure.Commands.ServiceBus.format.ps1xml' because it does not exist.. Please make sure that a valid value is specified for this field in file 'C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\AzureRM.ServiceBus\AzureRM.ServiceBus.psd1'.

As suggested on Error loading azure.profile in 1.0.5, I reinstalled azure PowerShell using "Install-Module AzureRM -Verbose -Force". After that New-AzureRmServiceBusNamespace is identified but getting below error

"The term 'Login-AzureRmAccount' is not recognized as the name of a cmdlet, function, script file, or operable program.".

The solution to fix this error is reinstalling Azure PowerShell by using MSI. After that Login-AzureRmAccount is identified but New-AzureRmServiceBusNamespace goes missing again. I'm going in circles.

I've to make New-AzureRmServiceBusNamespace work without breaking Login-AzureRmAccount. Please help me.

Shui shengbao
  • 18,746
  • 3
  • 27
  • 45
Venky
  • 177
  • 3
  • 13

2 Answers2

1

Please check your Azure PowerShell version firstly, you could use the following cmdlet.

Get-Module -ListAvailable -Name Azure -Refresh

My version is 3.6.0. New-AzureRmServiceBusNamespace and Login-AzureRmAccount all work for me. If your version is not latest, I suggest you could update your version to latest. You can download the PS version 3.6.0 installation file from this link.

Update from comment:

When OP upgrade his laptop from Windows 7 to Windows 10, it works fine.

Shui shengbao
  • 18,746
  • 3
  • 27
  • 45
  • Azure is 3.5.0 and AzureRm is 3.6.0. Looks like few others also are facing same issue https://github.com/Azure/azure-powershell/issues/3443. Please let me know how you installed azure powershell (web platform installer, powershell or MSI)? It would be great if you can specify the steps. – Venky Mar 06 '17 at 20:45
  • @Venky I install powershell by using MSI(the link I provided you). If you had install Azure Powershell, it will coverage and upgrade original version. – Shui shengbao Mar 07 '17 at 01:06
  • If i install using MSI then New-AzureRmServiceBusNamespace is not available. One of my co-worker has windows 10 and it is working absolutely fine on his machine. My machine has Windows 7. I tried almost everything and for some reason it is not working. I'll upgrade to Windows 10 and then try again. Thank you for your help. – Venky Mar 08 '17 at 19:30
  • My laptop got upgraded to windows 10 and it is all working fine now. @Walter Thank you very much for your help. – Venky Mar 09 '17 at 14:47
0

I would remove the Azure powershell that was installed by msi (completely) and reboot, after that I'd check C:\Program Files\WindowsPowerShell\Modules directory and delete all Azure related modules from there. After that, I'd do Install-Module AzureRM

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
  • Login-AzureRmAccount is not recognized when azure powershell is installed using Install-Module command. – Venky Mar 03 '17 at 22:05