Azure Powershell Cmds Does Not Work in ISE

The Windows Azure Powershell console does not seem to have the same configuration as the ISE.

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

Now when I log into 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 see that 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...}

ISE is missing a missing Azure module.

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 to the Azure module and import it like this:

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

But Get-AzureVMImage is still not working. How to make the shell and ISE behave exactly the same?

thank

+4
source share
1 answer

, Azure Powershell, ISE Azure. Import-Module.

+9

Source: https://habr.com/ru/post/1542530/


All Articles