Removes a virtual disk from the specified XenServer hosted virtual machine.



Remove-EmcXenServerVirtualDisk -VirtualMachineConfiguration <VirtualMachineConfiguration> -Location <UInt32> [-Force] [-Silent] [-WhatIf] [-Confirm] [<CommonParameters>]



VirtualMachineConfiguration <VirtualMachineConfiguration>

Attributes: Required, Position: named

Specifies the virtual machine to which the virtual disk is attached.


-Location <UInt32>

Attributes: Required, Position: named

Specifies the location of the virtual disk.


-Force <SwitchParameter>

Attributes: Optional, Position: named

Allows the cmdlet to continue without asking for user confirmation.


-Silent <SwitchParameter>

Attributes: Optional, Position: named

Turns off all the informational and verbose messages. However, it still displays errors.


-WhatIf <SwitchParameter>

Attributes: Optional, Position: named

Shows what would happen if the cmdlet runs. The cmdlet is not run.


-Confirm <SwitchParameter>

Attributes: Optional, Position: named

Prompts you for confirmation before executing the command.



This cmdlet supports these common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, and OutVariable. Type get-help about_commonparameters for more details.



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

C:\PS>$vdi = Get-EmcXenServerVirtualDiskImage -ID testVDI -Silent

C:\PS>$vm = Get-EmcHostSystem myXen

C:\PS>$vmconfig = Get-EmcVirtualMachineConfiguration -VirtualMachine $vm

C:\PS>$vdiskconfig = Add-EmcXenServerVirtualDisk -VirtualDisk $vdi -VirtualMachineConfiguration $vmconfig



C:\PS>Remove-EmcXenServerVirtualDisk -VirtualMachineConfiguration $vmconfig -Location 5

This example removes the virtual disk from the virtual machine in the specified location 5.