< Back

Get-AzureUtilNonAttachedManagedDisk

Sat Jan 11, 2020 12:17 pm

NAME Get-AzureUtilNonAttachedManagedDisk



SYNOPSIS

Get the managed disks that non-attached to any virtual machines from the entire subscription.





SYNTAX

Get-AzureUtilNonAttachedManagedDisk [[-ExcludeResourceGroup] <String[]>] [<CommonParameters>]





DESCRIPTION

Get the managed disks that non-attached to any virtual machines from the entire subscription.





PARAMETERS

-ExcludeResourceGroup <String[]>

This cmdlet is ignore the resource groups that provided by this parameter. This parameter is optional.



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Microsoft.Azure.Commands.Compute.Automation.Models.PSDiskList





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-AzureUtilNonAttachedManagedDisk



---- Example Description ----

In this example, it is to get the all non-attached managed disk resources in the current subscription.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-AzureUtilNonAttachedManagedDisk -ExcludeResourceGroup 'Prod-RG','Test-RG'



---- Example Description ----

In this example, it is to get the all non-attached managed disk resources in the current subscription except the

disk resources in the "Prod-RG" and "Test-RG" resource groups.









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Get-AzureUtilNonAttachedManagedDisk | Remove-AzureRmDisk -Verbose



---- Example Description ----

In this example, it is to remove the all non-attached managed disk resources in the current subscription.











RELATED LINKS

PowerShell Gallery: https://www.powershellgallery.com/packages/AzureUtil/

GitHub: https://github.com/tksh164/AzureUtil-PowerShellModule

Get-AzureUtilNonAttachedUnmanagedDisk

Get-AzureUtilEmptyResourceGroup