Remove-HardDisk

This cmdlet removes the specified virtual hard disks.

Syntax

-HardDisk  <HardDisk[]>
[-DeletePermanently]
[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.

    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

    Feedback

    Was this page helpful?