gpt4 book ai didi

powershell - Azure Powershell Cmds 在 ISE 中不起作用

转载 作者:行者123 更新时间:2023-12-04 17:34:52 25 4
gpt4 key购买 nike

Windows Azure Powershell 控制台似乎没有与 ISE 相同的配置。

例如,打开控制台窗口后,以下 cmdlet 可以工作:Get-AzureVMImage

现在,当我进入 ISE 打开 ISE 应用程序时,找不到相同的 cmdlet。

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.

我可以看到控制台窗口包含以下模块:

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 显示 Azure 模块丢失。

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...}

因此,我获取了 Azure 模块的路径并像这样导入它:

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

但是 Get-AzureVMImage 仍然不起作用。如何使 shell 和 ISE 的行为完全相同?

谢谢

最佳答案

事实证明,您需要在安装 Azure Powershell 命令后重新启动,然后 ISE 将看到所有 Azure cmdlet。无需运行导入模块。

关于powershell - Azure Powershell Cmds 在 ISE 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23939486/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com