vSphere PowerCLI Reference

Remove-HardDisk

Synopsis

Removes the specified virtual hard disks.

Syntax

Remove-HardDisk [-HardDisk] <HardDisk[]> [-DeletePermanently] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Copy-HardDisk
Get-HardDisk
New-HardDisk
Set-HardDisk
Move-HardDisk

Detailed Description

Removes the specified virtual hard disks.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
HardDiskHardDisk[]Specify the hard disks you want to remove.truetrue (ByValue)
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falsefalse$true
DeletePermanentlySwitchParameterIndicate that you want to delete the hard disks not only from the inventory, but from the datastore as well.falsefalse
WhatIfSwitchParameterIndicate that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

none

Notes

Examples

-------------- Example 1 --------------

Get-HardDisk -VM $vm | Remove-HardDisk

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


Copyright © 1998 - 2012 VMware, Inc. All rights reserved.