Remove-HardDisk Command | Vmware PowerCLI Reference

Remove-HardDisk

This cmdlet removes the specified virtual hard disks.

Syntax

Remove-HardDisk
-HardDisk < HardDisk[] >
[-DeletePermanently ]
[-ProgressAction < ActionPreference > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
HardDisk HardDisk[] named
  • pipeline
Specifies the hard disks you want to remove.
optional DeletePermanently SwitchParameter named
Indicates that you want to delete the hard disks not only from the inventory, but from the datastore as well.
optional ProgressAction ActionPreference named

Output

Examples

Example 1

Get-HardDisk -VM $vm | Remove-HardDisk

Removes the hard disks of the virtual machine stored in the $vm variable.

Example 2

$hdd = Get-HardDisk -VM 'MyVM' -Name 'Hard disk 4'
Remove-HardDisk -HardDisk $hdd

Removes the 'Hard disk 4' hard disk of the 'MyVM' virtual machine.

Related Commands

HardDisk

Copies a virtual hard disk to another destination.

This cmdlet retrieves the virtual hard disks available on a vCenter Server system.

This cmdlet moves a hard disk from one location to another.

This cmdlet creates a new hard disk on the specified location.

This cmdlet removes the specified virtual hard disks.

This cmdlet modifies the properties of the specified virtual hard disk.