AzureRM PowerShell Mac OS X
I recently had to install Powershell on my Mac (sigh) (bigger sigh) and I run into issues by trying to get AzureRM to work. Among others:
Login-AzureRmAccount : The ‘Login-AzureRmAccount’ command was found in the module ‘AzureRM.profile’, but the module could not be loaded. For more information, run ‘Import-Module
AzureRM.profile’.
At /Users/iassael/Drive/Code/projects/azure/BulkAddAAD.ps1:5 char:1
+ Login-AzureRmAccount
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Login-AzureRmAccount:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
Everything can be resolved by installing AzureRM from here:
Install-Package -Name AzureRM.NetCore.Preview -Source https://www.powershellgallery.com/api/v2/ -ProviderName NuGet -ExcludeVersion -Destination $home/powershell/modules
Import-Module $home/powershell/modules/AzureRM.Profile.NetCore.Preview
Import-Module $home/powershell/modules/AzureRM.Resources.NetCore.Preview
Import-Module $home/powershell/modules/AzureRM.NetCore.Preview
Login-AzureRmAccount
PS. Import-Module would have to be rerun every time powershell is restarted.