Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 调用AzureRmResourceAction:管道已停止_Powershell_Azure_Azure Resource Manager - Fatal编程技术网

Powershell 调用AzureRmResourceAction:管道已停止

Powershell 调用AzureRmResourceAction:管道已停止,powershell,azure,azure-resource-manager,Powershell,Azure,Azure Resource Manager,偶尔在执行Invoke-AzureRmResourceAction-poweshell命令时,我会遇到以下异常 调用AzureRmResourceAction:管道已停止。 调用AzureRmResourceAction-ResourceGroupName$ResourceGroupName-R。。。 +CategoryInfo:CloseError:(:)[Invoke AzureRmResourceAction],PipelineStoppedException +FullyQualifie

偶尔在执行Invoke-AzureRmResourceAction-poweshell命令时,我会遇到以下异常

调用AzureRmResourceAction:管道已停止。 调用AzureRmResourceAction-ResourceGroupName$ResourceGroupName-R。。。 +CategoryInfo:CloseError:(:)[Invoke AzureRmResourceAction],PipelineStoppedException +FullyQualifiedErrorId:Microsoft.Azure.Commands.ResourceManager.cmdlet.Implementation.InvokAzureResourceAction Cmdlet


我应该如何处理这个错误?我应该捕获它并重试吗?通常只需重新运行该命令即可。如果您使用的是ForEach对象commandlet,请尝试用ForEach语句替换它

# your code like this
Get-Something | ForeachObject {Invoke-AzureRmResourceAction $_} 
# replace with this
foreach ($Obj in Get-Something) {
  Invoke-AzureRmResourceAction $Obj
}

如果您正在使用ForEach对象commandlet,请尝试用ForEach语句替换它

# your code like this
Get-Something | ForeachObject {Invoke-AzureRmResourceAction $_} 
# replace with this
foreach ($Obj in Get-Something) {
  Invoke-AzureRmResourceAction $Obj
}