"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
powershell azure cmdlets azure-powershell octopus-deploy


source to share


No one has answered this question yet

Check out similar questions:

1488
PowerShell says "scripting is disabled on this system."
648
How to run a PowerShell script
2
Powershell Laser Automation
1
How to delete a folder on an Azure Service website using Octopus Deploy
1
Create self-signed Azure certificate with powershell command Invoke-AddCertToKeyVault
1
Windows Azure PowerShell cmdlet error - file skipped because it was already present
1
The term "New-AzureRmServiceBusNamespace" is not recognized as the name of a cmdlet, function, script file, or operating program
0
How do I resolve "The Azure PowerShell session was not initialized correctly. Please import the module and try again" when loading these modules?
0
Azure powershell not running, version issue
-1
Windows Azure Powershell Installation Error



All Articles
Loading...
X
Show
Funny
Dev
Pics