2013-05-02 82 views
0

我已經下載的第一行用「AzureManagementToolsSnapin」下面一個腳本: 添加-PSSnapin AzureManagementToolsSnapinPowerShell管理單元「AzureManagementToolsSnapin」未安裝此計算機

我閱讀一些博客和下載從下面的鏈接的Azure Powershell CMDLets: http://wappowershell.codeplex.com/releases/view/84058

當我試圖安裝每個給定的文檔下面的鏈接我無法安裝。然而,它記錄下面,我完全不明白爲什麼錯誤:

安裝裝配 'C:\ WindowsAzure \ WAPPSCmdletsBin \發佈\ Microsoft.WindowsAzure.Samples.ManagementTools.Powershell.dll'。 受影響的參數是:i = assemblypath = C:\ WindowsAzure \ WAPPSCmdletsBin \釋放\ Microsoft.WindowsAzure.Samples.ManagementTools.Powershell.dll 日誌= C:\ WindowsAzure \ WAPPSCmdletsBin \釋放\ Microsoft.WindowsAzure.Samples.ManagementTools .Powershell.InstallLog logtoconsole =嘗試在 C:\ WindowsAzure \ WAPPSCmdletsBin \ release \ Microsoft.WindowsAzure.Samples.ManagementTools.Powershell.dll程序集中找到 安裝程序時發生異常。 System.Reflection.ReflectionTypeLoadException:無法加載 一個或多個請求的類型。檢索LoaderExceptions 屬性以獲取更多信息。終止安裝 C:\ WindowsAzure \ WAPPSCmdletsBin \ release \ Microsoft.WindowsAzure.Samples.ManagementTools.Powershell.dll。 回滾程序集 'C:\ WindowsAzure \ WAPPSCmdletsBin \ release \ Microsoft.WindowsAzure.Samples.ManagementTools.Powershell.dll'。 受影響的參數是:i = assemblypath = C:\ WindowsAzure \ WAPPSCmdletsBin \釋放\ Microsoft.WindowsAzure.Samples.ManagementTools.Powershell.dll 日誌= C:\ WindowsAzure \ WAPPSCmdletsBin \釋放\ Microsoft.WindowsAzure.Samples.ManagementTools .Powershell.InstallLog logtoconsole =嘗試在 C:\ WindowsAzure \ WAPPSCmdletsBin \ release \ Microsoft.WindowsAzure.Samples.ManagementTools.Powershell.dll程序集中找到 安裝程序時發生異常。 System.Reflection.ReflectionTypeLoadException:無法加載 一個或多個請求的類型。檢索LoaderExceptions 屬性以獲取更多信息。終止安裝 C:\ WindowsAzure \ WAPPSCmdletsBin \ release \ Microsoft.WindowsAzure.Samples.ManagementTools.Powershell.dll。

請問,有人可以幫助我瞭解我失蹤了什麼。我也嘗試從下面下載: http://www.windowsazure.com/en-us/downloads/

但是,我下載的腳本上的很多功能似乎並不存在於Windows Azure PowerShell中。

PowerShell的代碼片段看起來像下面,不知道它的過時:

Add-PSSnapin AzureManagementToolsSnapIn 

#bla bla 

Get-HostedServices -SubscriptionId $sub -Certificate $cert|Select ServiceName| 

foreach { 
#Logic here 
$service = $_.ServiceName 

write-host $service 

$deployId = (Get-HostedService $service -SubscriptionId $sub -Certificate $cert | Get-Deployment Staging).DeploymentId  

Get-DiagnosticAwareRoles -StorageAccountName $storage -StorageAccountKey $key -DeploymentId $deployId | 

foreach { 

    #DO stuff here 

    } 

} 



} 

感謝。

回答

0

Codeplex站點表示您的第二個鏈接現在是從其下載的正確鏈接。在底部,在命令行工具下,是PowerShell的鏈接。

我下載了,安裝後,啓動了一個新的PoSH會話,發現有一個Azure 模塊,但沒有管理單元。我似乎回想起微軟正在推動每個人從管理單元轉向模塊。

Directory: C:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell 


ModuleType Name        ExportedCommands 
---------- ----        ---------------- 
Binary  Azure        {Disable-AzureServiceProjectRemoteDesktop, Enable-AzureMemcacheRole, ... 

沒有腳本,你實際上試圖執行,這是不可能的診斷你的具體問題。但是你可能正在處理一些有點過時的事情,你至少需要切換到加載模塊而不是管理單元。原帖編輯後

編輯:

叫你的樣品中的cmdlet不要在Azure模塊中存在,但Get-AzureDeployment可能映射到Get-DeploymentGet-AzureService可能地圖Get-HostedServicesGet-AzureRole可能地圖Get-DiagnosticAwareRoles - 但我不知道Azure。

簡短的版本是,如果Codeplex管理單元不適合你,官方的話是你應該使用從微軟下載的模塊(我上面提到的那個),你要去必須做出一些調整。

+0

請參閱上面更新的powershell片段。不確定它是否過時。 – 2013-05-02 12:47:38

+0

@Myagdi - 看我的編輯 – alroc 2013-05-02 13:17:55

相關問題