当前位置 : 主页 > 网络安全 > 测试自动化 >

powershell – Set-AzureRmAutomationModule无法找到自动化帐户

来源:互联网 收集:自由互联 发布时间:2021-06-19
我正在尝试将自定义DSC模块上传到我们的Azure自动化帐户. C:\Code\Epitec DSC [master ≡ +1 ~1 -1 !] Set-AzureRmAutomationModule -Name "WindowsUpdate" -ContentLinkUri "{ContentURL}.zip" -ResourceGroupName "OI-Default-East-
我正在尝试将自定义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        : lsmith@epitec.com
Tags                  : {}

我也试过像这样穿过它

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自动化该过程.

我无法回复评论,但拉里,您是否有可能使用subscriptionname而不是subscriptionid来连接您尝试创建的连接?

尝试使用-debug运行命令,它会引导您获得更多洞察力.我刚刚找到了我的问题就是这样

网友评论