Get-AzurePublishSettingsFile给出了Class not registered错误

时间:2012-08-22 08:58:49

标签: powershell azure

我安装了Azure Powershell Command(从这里https://www.windowsazure.com/en-us/manage/downloads

我也跑了

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

5 个答案:

答案 0 :(得分:5)

在使用Chrome作为我的默认浏览器时,我在Windows 8上遇到了完全相同的问题。

解决方案是将 Internet Explorer 作为打开浏览器相关文件的默认程序,例如*.html

Internet Explorer > Internet Settings > Programs > Set associations = Select all

这就是诀窍。也许单个条目就足够了,但我没有检查。

答案 1 :(得分:2)

检查$pshome

中的值是多少

如果您在32位模式下看到%windir%\System32\WindowsPowerShell\v1.0正在运行这是您要用于Windows Azure PowerShell Cmdlet的PowerShell版本。

如果您看到%windir%\SysWOW64\WindowsPowerShell\v1.0您正在x64模式下运行,这可能会导致问题。

答案 2 :(得分:1)

另外,请确保您没有运行PowerShell'作为管理员'

答案 3 :(得分:0)

您需要证书的私钥(或其上)才能使其正常工作。经过大量的追踪和错误,我发现了这一点。

但简而言之,如果您的证书管理员在证书上没有一个小钥匙图标(屏幕截图中的第二个证书),则表示您没有私钥,这意味着Powershell将无法使用连接到Azure。

enter image description here

我记下了我在这里学到的东西:

Management certificates and powershell deployment to windows azure

答案 4 :(得分:0)

我使用非管理员帐户打开PowerShell,然后才能运行。

注意启动该命令会在此url打开一个网页,以下载Azure帐户的发布设置文件。

如此有效,您可以在不使用命令的情况下打开上面的链接。

希望这有帮助。