Syntax
Copy-DeployRule [-DeployRule] <DeployRule> [-Name <String>] [-AllHosts] [-ReplaceItem <VIObjectCore[]>] [-ReplacePattern <String[]>] [-NoUpdateRuleSet] [-NoActivate] [<CommonParameters>]Related Commands
New-DeployRuleDetailed Description
Clones an existing rule. If you specify -Name, the new rule is assigned the specified name. Otherwise, the cmdlet assigns a new name to the original and gives the clone the name of the original rule. ^MParameters
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
DeployRule | DeployRule | Rule to copy. This parameter support s object-by-name, so you can pass the name of the rule. | true | true (ByValue) | |
AllHosts | SwitchParameter | If you specify AllHosts, the rule is applied to all hosts. | false | false | |
Name | String | If -Name is specified, the cmdlet assigns the name to the new rule. Otherwise, the new rule keeps the old name and the old name is renamed. | false | false | |
NoActivate | SwitchParameter | If specified, the cmdlet changes the rule and adds it to the working rule set, but does not activate the w orking rule set. | false | false | |
NoUpdateRuleSet | SwitchParameter | If specified, the cmdlet changes the rule but does not add the changed rule to the working and active rule set. | false | false | |
ReplaceItem | VIObjectCore[] | Allows you to make a copy and change individual items, for example the image profile the rule assigns. This parameter supports object-by-name, so you can pass the name of the item. | false | false | |
ReplacePattern | String[] | Allo ws you to make a copy and change individual patterns, for example the set of hosts the rule applies to. | false | false |
Return Type
VMware.DeployAutomation.Types.DeployRuleNotes
Examples
-------------- Example 1 --------------
C:\PS> Copy-DeployRule defimg -ReplaceItem "My New ESXi 5.0"
Copies a rule previously retrieved with Get-DeployRule and replaces the image in that rule with the specified image.
----- --------- Example 2 --------------
C:\PS> $img = Get-ESXImageProfile -Name "My New ESXi 5.0" C:\PS> Copy-DeployRule defimg -ReplaceItem $img
Copies a rule previously retrieved with Get-DeployRule and replaces the image in that rule with the specified image.
----- --------- Example 3 --------------
C:\PS> $bundle = Get-ScriptBundle -Name "MyscriptBundle" C:\PS> Copy-DeployRule defimg -ReplaceItem $bundle
Copies a rule previously retrieved with Get-DeployRule and replaces the bundle in that rule with the specified bundle.