Set-SCCustomPlacementRule

Modifes a custom placement rule in the placement configuration of a host group.

Description

The Set-SCCustomPlacementRule modifes an existing custom placement rule in the placement configuration for a host group.

For more information about Set-SCCUstomPlacementRule, type: "Get-Help Set-SCCustomPlacementRule -online".

Parameters

CustomPlacementRule

Required? true
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a custom placement rule object.

MustMatch

Required? true
Accept Pipeline Input? false
Position? named
Indicates that the property value of the virtual machine must match the host.

Confirm

Required? false
Accept Pipeline Input? false
Position? named
Prompts for confirmation before running the command.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

VMMServer

Required? false
Accept Pipeline Input? false
Position? named
Specifies a VMM server object.

CustomPlacementRule

Required? true
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a custom placement rule object.

MustNotMatch

Required? true
Accept Pipeline Input? false
Position? named
Indicates that the property value of the virtual machine must not match the host.

Confirm

Required? false
Accept Pipeline Input? false
Position? named
Prompts for confirmation before running the command.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

VMMServer

Required? false
Accept Pipeline Input? false
Position? named
Specifies a VMM server object.

CustomPlacementRule

Required? true
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a custom placement rule object.

ShouldMatch

Required? true
Accept Pipeline Input? false
Position? named
Indicates that the property value of the virtual machine should match the host.

Confirm

Required? false
Accept Pipeline Input? false
Position? named
Prompts for confirmation before running the command.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

VMMServer

Required? false
Accept Pipeline Input? false
Position? named
Specifies a VMM server object.

CustomPlacementRule

Required? true
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a custom placement rule object.

ShouldNotMatch

Required? true
Accept Pipeline Input? false
Position? named
Indicates that the property value of the virtual machine should not match the host.

Confirm

Required? false
Accept Pipeline Input? false
Position? named
Prompts for confirmation before running the command.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

VMMServer

Required? false
Accept Pipeline Input? false
Position? named
Specifies a VMM server object.

Examples

1: Modify an existing custom placement rule in the placement configuration for a host group.
PS C:\> $HostGroup = Get-SCVMHostGroup "HostGroup01"
PS C:\> $PlacementConfig = Get-SCPlacementConfiguration -VMHostGroup $HostGroup
PS C:\> $CPRule = Get-SCCustomPlacementRule -PlacementConfiguration $PlacementConfig | where {$_.CustomPropertyName -eq "Charge Code"}
PS C:\> Set-SCCustomPlacementRule -MustMatch -CustomPlacementRule $CPRule
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 third command gets the custom placement rule object named Charge Code and stores the object in the $CPRule variable

The last command modifes the custom placement rule for custom property Charge Code to be a Must Match rule

See Also