Skip to content

Get-StorageBlobReport

Azure: Gets a report of storage blobs

param(
	[Parameter(Mandatory = $true)]
	[string]$Container,

	[Parameter(Mandatory = $true)]
	[string]$StorageAccountName
)

try {
	Import-Module Az.Storage -ErrorAction Stop
	$ctx = (Get-AzStorageAccount -ResourceGroupName "*" -Name $StorageAccountName -ErrorAction Stop).Context
	$blobs = Get-AzStorageBlob -Container $Container -Context $ctx -ErrorAction Stop | Select-Object Name, BlobType, Length, LastModified
	Write-Output $blobs
} catch {
	Write-Error $_
	exit 1
}

The name of the storage container.

The name of the storage account.

An interactive directory of PowerShell scripts.