Removing clusters

The Remove-Cluster cmdlet will remove a cluster from your vSphere inventory. The Remove-Cluster cmdlet has the following syntax:

Remove-Cluster [-Cluster] <Cluster[]> [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>]

The next example will remove the Cluster02 cluster that was created at the beginning of this chapter:

PowerCLI C:\> Remove-Cluster -Cluster Cluster02 -Confirm:$false

Tip

Be careful. Removing a cluster will also remove all of the hosts and virtual machines in the cluster!

Get Learning PowerCLI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.