powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Copy-DeployRule



NAME
Copy-DeployRule

SYNOPSIS
Clones an existing rule.

SYNTAX
Copy-DeployRule [-DeployRule] [-Name ] [-AllHosts] [-ReplaceItem ] [-ReplacePa
ttern ] [-NoUpdateRuleSet] [-NoActivate] []


DESCRIPTION
Clones an existing rule. If you specify -Name, the new rule is assigned the specified name. Otherwise, the cmdlet a
ssigns a new name to the original and gives the clone the name of the original rule.

Use the -ReplaceItem and -ReplacePattern options to replace individual items or patterns from the old rule.

If the old rule was in the working rule set, the cmdlet replaces it with the new rule unless you specify the -NoUpd
ateRuleSet option.

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


PARAMETERS
-DeployRule
Rule to copy. This parameter supports object-by-name, so you can pass the name of the rule.

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

-Name
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.

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

-AllHosts
If you specify AllHosts, the rule is applied to all hosts.

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

-ReplaceItem
Allows you to make a copy and change individual items, for example the image profile the rule assigns. This par
ameter supports object-by-name, so you can pass the name of the item.

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

-ReplacePattern
Allows you to make a copy and change individual patterns, for example the set of hosts the rule applies to.

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

-NoUpdateRuleSet
If specified, the cmdlet changes the rule but does not add the changed rule to the working and active rule set.

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

-NoActivate
If specified, the cmdlet changes the rule and adds it to the working rule set, but does not activate the workin
g rule set.

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".

INPUTS



OUTPUTS
VMware.DeployAutomation.Types.DeployRule


NOTES




-------------- 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
.






RELATED LINKS
New-DeployRule
Get-ESXImageProfile
Get-Cluster
Get-Datacenter
Get-Folder
Get-VMHostProfile