< Back

Remove-AzureDisk

Wed Jan 30, 2019 5:50 pm

NAME Remove-AzureDisk



SYNOPSIS

Removes a disk from the Azure disk repository.





SYNTAX

Remove-AzureDisk [-DiskName] <String> [-DeleteVHD] [-Profile <AzureSMProfile>] [-InformationAction <ActionPreference>] [-InformationVariable <String>]

[<CommonParameters>]





DESCRIPTION

The Remove-AzureDisk cmdlet removes a disk from the Azure disk repository in the current subscription. By default, this cmdlet does not delete the

virtual hard disk (VHD) file from blob storage. To delete the VHD, specify the DeleteVHD parameter.





PARAMETERS

-DiskName <String>

Specifies the name of the data disk in the disk repository that this cmdlet removes.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DeleteVHD [<SwitchParameter>]

Indicates that this cmdlet removes the VHD from blob storage.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Profile <AzureSMProfile>

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationAction <ActionPreference>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationVariable <String>





Required? false

Position? named

Default value None

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



NOTES









-------------------------- Example 1: Remove a disk --------------------------



PS C:\\>Remove-AzureDisk -DiskName "ContosoDataDisk"



This command removes the disk named ContosoDataDisk disk from the disk repository. The command does not delete the VHD.

-------------------------- Example 2: Remove and delete a disk --------------------------



PS C:\\>Remove-AzureDisk -DiskName "ContosoDataDisk" -DeleteVHD



This command removes the disk named ContosoDataDisk disk from the disk repository. This command specifies the DeleteVHD parameter. Therefore, the

command deletes the VHD from Azure Storage.



RELATED LINKS

Add-AzureDisk

Get-AzureDisk

Update-AzureDisk