Remove-SCVMHostGroup
Removes a host group from VMM.
Syntax
Remove-SCVMHostGroup
[-VMHostGroup] <HostGroup>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Remove-SCVMHostGroup cmdlet removes one or more host group objects from the Virtual Machine Manager (VMM) database. A host group cannot be deleted if it is associated with a private cloud, if it has hosts assigned to it, or if its child host group has hosts assigned to it. This cmdlet will delete child host groups if the host group and its child host groups do not contain any virtual machine hosts.
This cmdlet returns the object upon success (with the MarkedForDeletion property set to True) or returns an error message upon failure.
Examples
Example 1: Remove the specified host group
PS C:\> $HostGroup = Get-SCVMHostGroup -Name "HostGroup02"
PS C:\> Remove-SCVMHostGroup -VMHostGroup $HostGroup
The first command gets the host group named HostGroup02 and stores it in the $HostGroup variable.
The second command removes the host group object stored in the $HostGroup variable.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobVariable
Specifies that job progress is tracked and stored in the variable named by this parameter.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PROTipID
Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMHostGroup
Specifies a virtual machine host group object.
Type: | HostGroup |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Notes
- Requires a VMM host group object, which can be retrieved by using the Get-SCVMHostGroup cmdlet.