For system, network and cloud administrators

How to delete all Azure managed disks that start with a pattern using Azure PowerShell

In order to remove all Azure managed disks that start with the name disk, in your PowerShell session type:

Get-AzDisk -ResourceGroupName yourgroupresource -Name 'disk*' | Remove-AzDisk -Force -Verbose

The above command can also support the -AsJob parameter which will allow you to execute further PowerShell commands (in the same session) while the command is being executed in the background as in asynchronously.

Leave a Reply

Your email address will not be published.