Removing Virtualization-Clusters

Removes the specified Virtualization-Cluster object(s).


Examples:


Hint: The execution of these examples requires a connected PowerShell drive.


The following example deletes the Virtualization-Cluster "XenFarm01" in the context "Virtual Environments\XenFarms" using the Remove-EmdbVirtualizationCluster cmdlet:


Remove-EmdbVirtualizationCluster "emdb:\rootDSE\Managed Virtual Environments\XenFarms\XenFarm01"


Without specifying the path, the command below deletes the Virtualization-Cluster "XenFarm02" in the current context:


cd "emdb:\rootDSE\Managed Virtual Environments\XenFarms"

Remove-EmdbVirtualizationCluster "XenFarm02"


Alternatively, the the following snippet deletes a Virtualization-Cluster object named "XenFarm03" in the context "Virtual Environments\XenFarms" by utilizing the object's Delete()-Method:


$MyVirtualizationCluster = Get-EmdbVirtualizationCluster "emdb:\rootDSE\Managed Virtual Environments\XenFarms\XenFarm03"

$MyVirtualizationCluster.Delete()


A third way of deleting Virtualization-Clusters by using the Remove-Item cmdlet is shown in the following example:


Remove-Item "emdb:\rootDSE\Managed Virtual Environments\XenFarms\XenFarm04"


Hint: Alternatively the alias DEL can be used to remove Virtualization-Cluster objects.


Starting with PSX 3.1 there was a new option implemented when deleting Virtualization-Cluster objects. When specifying the SingleItemExpected-switch it is expected, that none or exactly one object is affected. If the command would delete more than one object, an error is raised that can be caught and handled in scripts.