Powershell Get-AzurePublishSettings文件给出类未注册错误
我安装了Azure Powershell命令let(从这里开始) 我还运行了Powershell Get-AzurePublishSettings文件给出类未注册错误,powershell,azure,Powershell,Azure,我安装了Azure Powershell命令let(从这里开始) 我还运行了 Set-ExecutionPolicy RemoteSigned 然后,我在管理员凭据下运行Windows Azure PowerShell 但是,我得到以下错误 Get-AzurePublishSettingsFile : Class not registered At line:1 char:1 + Get-AzurePublishSettingsFile + ~~~~~~~~~~~~~~~~~~~~~~~~~~
Set-ExecutionPolicy RemoteSigned
然后,我在管理员凭据下运行Windows Azure PowerShell
但是,我得到以下错误
Get-AzurePublishSettingsFile : Class not registered
At line:1 char:1
+ Get-AzurePublishSettingsFile
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzurePublishSettingsFile], Win32Exception
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.Cmdlets.GetAzurePublishSettingsCommand
查看
$pshome
如果您看到%windir%\System32\WindowsPowerShell\v1.0
,则您正在32位模式下运行这是要用于Windows Azure PowerShell cmdlet的PowerShell版本。
如果您看到
%windir%\SysWOW64\WindowsPowerShell\v1.0
您正在x64模式下运行,这可能会导致问题。在使用Chrome作为默认浏览器时,我在Windows 8上遇到了完全相同的问题
解决方案是将Internet Explorer作为默认程序,用于打开与浏览器相关的文件,如*.html
Internet Explorer > Internet Settings > Programs > Set associations = Select all
这就成功了。也许一个条目就足够了,但我没有检查它。您需要证书的私钥(或证书上的私钥)才能正常工作。我经过多次尝试和错误才发现这一点 但简而言之,如果您的证书管理器在证书(屏幕截图中的第二个证书)上没有一个小密钥图标,则表示您没有私钥,这意味着Powershell将无法连接到Azure 我记下了我在这里学到的东西:
另外,请确保您没有以管理员身份运行powershell我使用非管理员帐户打开powershell,然后它就工作了 请注意,启动该命令将在此打开一个网页,以下载Azure帐户的发布设置文件 因此,您可以在不使用命令的情况下打开上面的链接
希望这有帮助。它是在32位版本($PSHOME=C:\Windows\System32\WindowsPowerShell\v1.0)下运行的。我正在运行Windows 8 RTM。还有什么可以检查的吗?