Skip to content

Get-StorageUsage

Azure: Gets storage usage

param(
	[Parameter(Mandatory = $false)]
	[string]$Location
)

try {
	Import-Module Az.Storage -ErrorAction Stop
	
	[hashtable]$cmdArgs = @{ 'ErrorAction' = 'Stop' }
	if ($Location) { $cmdArgs.Add('Location', $Location) }

	$usage = Get-AzStorageUsage @cmdArgs
	Write-Output $usage
} catch {
	Write-Error $_
	exit 1
}

The Azure region to check usage for (optional).

An interactive directory of PowerShell scripts.