"The Azure PowerShell message was not initialized correctly" error message in Octopus

I am trying to run a cmdlet Get-AzureRmEventHubNamespaceKey

in an Azure Powershell step in Octopus.

I am getting the following error:

Get-AzureRmEventHubNamespaceKey : The Azure PowerShell session has not been properly 
                                  initialized.  Please import the module and try again

      

The module is installed in the following directory on the Octopus server:

C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\AzureRM.EventHub

I tried to import the module first as part of the same step:

Import-Module –Name "C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\AzureRM.EventHub" -Verbose

And I see in the output that it was imported:

VERBOSE: Importing cmdlet 'Get-AzureRmEventHubNamespaceKey'.

But this is immediately followed by the error above. If I RDP to the octopus server and run directly from there, it works fine.

Any ideas on what might be causing this?

+3


source to share





All Articles