Set-DeployRule
Updates an existing rule with the specified items, patterns, or both. Rules cannot be changed once they have been used in the active rule set. Use Copy-DeployRule to make a copy of a rule with any desired changes.You must have the "AutoDeploy.Rule.Edit" privilege on the root folder of vCenter Server to use this cmdlet.
Syntax
-DeployRule
<DeployRuleWrapper>
[-AllHosts]
[-Item <VIObjectCore[]>]
[-Name <String>]
[-Pattern <String[]>]
[CommonParameters]
[-AllHosts]
[-Item <VIObjectCore[]>]
[-Name <String>]
[-Pattern <String[]>]
[CommonParameters]
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required |
|
DeployRuleWrapper | named |
|
The rule to be changed. Use the DeployRule or the Name parameter to specify the rule. | optional |
|
SwitchParameter | named |
|
Specify AllHosts to apply the changed rule to all hosts. Specify either AllHosts or Pattern. | optional |
|
VIObjectCore[] | named |
|
Item to apply to the specified hosts. The item can be an image profile, a host profile, or a cluster or folder in a vCenter Server system. This parameter supports object-by-name, so you can pass the name of the item. | optional |
|
String | named |
|
Name of the rule to apply changes to. Use the DeployRule or the Name parameter to specify the rule. | optional |
|
String[] | named |
|
Pattern that identifies the hosts to apply the rule to. Specify either AllHosts or Pattern.
Pattern strings use the following syntax:
|
Output
Examples
Example 1
C:\PS> Set-DeployRule $rule -Pattern "ipv4=192.168.1.10-192.168.1.20"
Updates the rule to apply to the hosts with IPv4 addresses in the specified range.
Related Commands
DeployRule
Gets a DeployRule object.
Adds one or more rules to the rule set.
Clones an existing rule.
Updates an existing rule.
Removes a rule from the working rule set.
Creates a new rule.
DeployRuleSet
Gets the current working rule set or the current active rule set.
Sets the list of rules in the working rule set.
DeployRuleSetCompliance
Remediate any non-compliant associations discovered by Test-DeployRuleSetCompliance
Checks whether hosts are compliant with rules.