Remove-SCCustomPlacementRule

Deletes a custom placement rule from a placement configuration.

Syntax

Remove-SCCustomPlacementRule [-Confirm] -CustomPropertyName <String> [-JobVariable <String>] [-PROTipID <Guid>]
 -PlacementConfiguration <PlacementConfigurationSettings> [-RunAsynchronously] [-VMMServer <ServerConnection>]
 [-WhatIf] [<CommonParameters>]

Description

The Remove-SCCustomPlacementRule cmdlet deletes a custom placement rule from a placement configuration for a host group.

Examples

Example 1: Remove a custom placement rule from a placement configuration

PS C:\> $HostGroup = Get-SCVMHostGroup "HostGroup01"
PS C:\> $PlacementConfig = Get-SCPlacementConfiguration -VMHostGroup $HostGroup
PS C:\> $PlacementConfig | Remove-SCCustomPlacementRule -CustomPropertyName "Cost Center" -Confirm

The first command gets the host group object named HostGroup01 and stores the object in the $HostGroup variable.

The second command gets the placement configuration object for the host group stored in $HostGroup and places the object in the $PlacementConfig variable.

The last command uses the pipeline operator to pass the placement configuration stored in $PlacementConfig to the Remove-SCCustomPlacementRule cmdlet. Remove-SCCustomPlacementRule removes the custom placement rule named Cost Center from the placement configuration for HostGroup01 after prompting the user for confirmation.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-CustomPropertyName

Specifies the name for a custom property.

Type:String
Required:True
Position:Named
Default value:None
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
Required:False
Position:Named
Default value:None
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
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PlacementConfiguration

Specifies a placement configuration object.

Type:PlacementConfigurationSettings
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

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

Type:SwitchParameter
Aliases:wi
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False