Powershell 删除runbook中不工作的AzureStorageBlob

Powershell 删除runbook中不工作的AzureStorageBlob,powershell,azure-storage-blobs,Powershell,Azure Storage Blobs,为什么下面的powershell代码在我的本地机器上运行得很好,但在Azure自动化运行手册中执行时失败了 Get-AzureStorageBlob -Container "workloads" -Prefix "aaa" | Remove-AzureStorageBlob 运行手册错误消息 Remove-AzureStorageBlob : The input object cannot be bound to any parameters for the command either be

为什么下面的powershell代码在我的本地机器上运行得很好,但在Azure自动化运行手册中执行时失败了

Get-AzureStorageBlob -Container "workloads" -Prefix "aaa" | Remove-AzureStorageBlob
运行手册错误消息

Remove-AzureStorageBlob : The input object cannot be bound to any parameters for the command either because the command 
does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline 
input.
At Remove-CID:116 char:116
+ 
    + CategoryInfo          : InvalidArgument: (Microsoft.Windo...zureStorageBlob:PSObject) [Remove-AzureStorageBlob],  ParameterBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,Microsoft.WindowsAzure.Commands.Storage.Blob.RemoveStorageAzureBlobCommand
笨重,但它能工作

$blobs = Get-AzureStorageBlob -Container $container -Prefix "aaa"

foreach($blob in $blobs)
{
    Remove-AzureStorageBlob -Blob $blob.Name -Container $container
}
找到了