5
votes

It seems Windows Azure Powershell console does not have the same configuration as the ISE.

For instance, after opening up the console windows the following cmdlet works: Get-AzureVMImage

Now when I enter ISE to open the ISE application the same cmdlet is not found.

Get-AzureVMImage : The term 'Get-AzureVMImage' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the 
name, or if a path was included, verify that the path is correct and try again.

I can see the console window contains the following modules:

ModuleType Name                                ExportedCommands
---------- ----                                ----------------
Binary     Azure                               {Add-AzureAccount, Add-AzureCacheWorkerRole, Add-AzureCertificate, Ad...
Manifest   Microsoft.PowerShell.Management     {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Content...}
Manifest   Microsoft.PowerShell.Security       {ConvertFrom-SecureString, ConvertTo-SecureString, Get-Acl, Get-Authe...
Manifest   Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object...}

The ISE is showing the Azure Module missing.

ModuleType Name                                ExportedCommands                                                                                                     
---------- ----                                ----------------                                                                                                     
Script     ISE                                 {Get-IseSnippet, Import-IseSnippet, New-IseSnippet}                                                                  
Manifest   Microsoft.PowerShell.Management     {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Content...}                                                   
Manifest   Microsoft.PowerShell.Security       {ConvertFrom-SecureString, ConvertTo-SecureString, Get-Acl, Get-AuthenticodeSignature...}                            
Manifest   Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object...}                                                            
Binary     Microsoft.WindowsAzure.Commands     {Get-AzureAutomationAccount, Get-AzureAutomationJob, Get-AzureAutomationJobOutput, Get-AzureAutomationRunbook...}    
Manifest   Microsoft.WSMan.Management          {Connect-WSMan, Disable-WSManCredSSP, Disconnect-WSMan, Enable-WSManCredSSP...}                                      

So I get the path of the Azure module and import it like so:

Import-Module "C:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell\ServiceManagement\Azure\Microsoft.WindowsAzure.Commands.dll"

But the Get-AzureVMImage still does not work. How to I get both the shell and the ISE to behave exactly the same?

Thanks

1
I'm sorry, I did not realize you were comparing the Azure Management Console and the ISE. I will remove my answer, as it is a poor one considering you aren't actually using the standard console. My suggestion is to run the script that the Azure Management Console runs to load the module and not just load it manually in the ISE. - TheMadTechnician

1 Answers

9
votes

Turns out that you need to reboot after installing the Azure Powershell commands and then the ISE will see all the Azure cmdlets. No need to run Import-Module.