Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Powershell Cmds Not working in ISE

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

like image 228
ChiliYago Avatar asked May 29 '14 17:05

ChiliYago


1 Answers

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.

like image 72
irhetoric Avatar answered Nov 14 '22 20:11

irhetoric