Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Remove-AzureVMDataDisk

Remove-AzureVMDataDisk

microsoft.azure.commands.compute.dll

Synopsis

Remove a Data Disk from the VM

Syntax

Remove-AzureVMDataDisk [-VM] [-Name] [-Profile] [-InformationAction] [-InformationVariable] [<CommonParameters>]

Detailed Description

This cmdlet allows you to remove a Data Disk from the VM

Parameters

-VM <PSVirtualMachine>

Local VM object to remove the Data Disk from. This object can be gotten from the Get-AzureVM cmdlet.

Aliases

None

Required?

true

Position

0

Default value

None

Accept pipeline input?

true (ByValue, ByPropertyName)

Accept wildcard characters?

false

-Name <String>

Name of the Data Disk to be removed

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Profile <AzureProfile>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-InformationAction <ActionPreference>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-InformationVariable <String>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

Input Type


Return Type


Notes

Examples

-------------------------- Remove a Data Disk --------------------------

PS C:\> # Get the VM
          $vm = Get-AzureVM -ResourceGroupName "myRG" -Name "crpVM"

          # Remove "disk3" Data Disk from the local object
          Remove-AzureVMDataDisk -VM $vm -Name 'disk3'

          # Update the state of the Azure VM
          Update-AzureVM -ResourceGroupName "myRG" -Name "crpVM" –VM $vm