This is a @Chris answer option. Chris used Exceptions and Try / Catch. On large systems, try / catch. This allows an error to be entered into the code to exclude an exception, and the system will cancel the call history by looking for the corresponding catch statement. However, when all the code is in one function, for simplicity, I prefer to check the return values:
$blob = Get-AzureStorageBlob -Blob $azureBlobName -Container $azureStorageContainer -Context $azureContext -ErrorAction Ignore
if (-not $blob)
{
Write-Host "Blob Not Found"
}
source
share