Tutorials  PowerShell Cmdlet Help for Add-DeployRule


Adds one or more rules to the rule set.

Add-DeployRule [-DeployRule] [[-At] ] [-NoActivate] []

Adds one or more rules to the working rule set and then activates the working rule set. The rule can be added at a
specific index with the "-At" option, otherwise it is added to the end. If you plan on making several changes to
the rule set, you can pass the "-NoActivate" option to avoid activing the rule set after every change.

A rule set is an ordered list of rules that determines what items, such as a host profile, should be associated wit
h a host. For each type of item, AutoDeploy will find a matching rule and select the item specified in that rule.
If more than one rule matches a host and the rules contain the same type of item, the item from the rule that come
s first in the rule set will be used. This behaviour makes it possible to write a single generic rule that matches
many hosts and then write more specific rules to override settings for specialized hosts.

The working rule set can be used to test out changes to the rule set against hosts in vCenter Server. Once you are
satisfied with the rules, you can activate the working rule set to control how any new hosts that are unknown to v
Center Server will be deployed.

You must have the "AutoDeploy.RuleSet.Edit" privilege on the root folder of vCenter Server to use this cmdlet.

Rule(s) to add to the rule set. You can pass a DeployRule object here or the name of the rule.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false

Index in the rule set where you want to add the rule. The placement of the rule in the set determines its prio
rity. Lower indexes have a higher priority.

Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false

Specify this parameter to add the rule to the working rule set but not to the active rule set. By default, the
working rule set is activated after the change.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".




-------------- Example 1 --------------

C:\PS> Get-DeployRule "testrule" | Add-DeployRule

Get a rule named "testrule" and add it to the end of the rule set.

-------------- Example 2 --------------

C:\PS> Add-DeployRule testrule -At 0

Add a rule named "testrule" to the beginning of the rule set.