azure - PowerShell Azure Blob 存储排除特定内容类型

标签 azure powershell azure-storage azure-blob-storage

我正在尝试列出所有不是 PDF 文件的 blob。我该怎么做呢? 我知道我可以像这样列出所有文件:

$StorageContext = New-AzStorageContext -StorageAccountKey XXX -StorageAccountName YYY
Get-AzStorageBlob -Container 'containerName' -Context $StorageContext

如果我想适应特定的内容类型(在下面的情况下为 png),我会将第二行更改为:

Get-AzStorageBlob -Container 'containerName' -Context $StorageContext -Blob *.png

但是我怎样才能显示除特定内容类型之外的任何内容。就我而言,我想列出除 PDF 之外的所有内容?

最佳答案

您可以使用下面的命令。

Get-AzStorageBlob -Container 'containerName' -Context $StorageContext | Where-Object {!($_.Name -like '*.pdf')}

enter image description here

关于azure - PowerShell Azure Blob 存储排除特定内容类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61130550/

相关文章:

.net - 如何查询DOTNET_CLI_TELEMETRY_OPTOUT是否永久设置为TRUE?

azure - windows azure虚拟机硬盘已满

ruby-on-rails - 使用 Rails (waz-storage gem) 将文件存储在 Windows Azure 存储中

azure - 将多个 Web 应用程序添加到应用程序服务环境

azure - 如何以编程方式创建 Azure 订阅和 Azure Active Directory

powershell - 如何一次将一个字符发送到 powershell 中的函数?

powershell - 在powershell中分组对象,选择每组中的第一项

azure - 无法使用已安装存储的 Linux 部署 Azure 应用服务的 ARM 模板

azure - 了解terraform中的共享模块和destroy命令,如何在销毁时排除共享模块?

sql-server - 服务器对象在 SQL Server Management Studio 中不可用