我正尝试将自定义DSC模块上传到我们的Azure自动化帐户。
C:\Code\Epitec DSC [master ≡ +1 ~1 -1 !]> Set-AzureRmAutomationModule -Name "WindowsUpdate" -ContentLinkUri "{ContentURL}.zip" -ResourceGroupName "OI-Default-East-US" -AutomationAccountName "Epitec-Automation" -Verbose Set-AzureRmAutomationModule : The Automation account was not found. At line:1 char:1 + Set-AzureRmAutomationModule -Name "WindowsUpdate" -ContentLinkUri "ht ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Set-AzureRmAutomationModule], ArgumentException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Automation.Cmdlet.SetAzureAutomationModule
运行命令Get-AzureRmAutomationAccount我能够获得自动化帐户
C:\Code\Epitec DSC [master ≡ +1 ~1 -1 !]> Get-AzureRmAutomationAccount -ResourceGroupName "OI-Default-East-US" -Name "Epitec-Automation" SubscriptionId : ResourceGroupName : OI-Default-East-US AutomationAccountName : Epitec-Automation Location : East US 2 State : Ok Plan : Free CreationTime : 12/29/2015 4:10:03 PM -05:00 LastModifiedTime : 10/12/2016 9:26:53 AM -04:00 LastModifiedBy : [email protected] Tags : {}
我也试过像这样pipe道
C:\Code\Epitec DSC [master ≡ +1 ~1 -1 !]> Get-AzureRmAutomationAccount -ResourceGroupName "OI-Default-East-US" -Name "Epitec-Automation" | Set-AzureRmAutomationModule -ContentLinkUri "{ContentURL}.zip" -Name "WindowsUpdate" Set-AzureRmAutomationModule : The Automation account was not found. At line:1 char:98 + ... tomation" | Set-AzureRmAutomationModule -ContentLinkUri "https://epit ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Set-AzureRmAutomationModule], ArgumentException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Automation.Cmdlet.SetAzureAutomationModule
我没有问题通过Azure门户网站上传zip文件,但是,我试图使用PowerShell自动化该过程。
我无法回复评论,但larry,有没有机会使用subscriptionname而不是subscriptionid作为你想创build连接的连接字段?
尝试使用-debug运行命令,它应该引导你更多的洞察力。 我刚刚发现我的问题,就是这样