vSphere Auto Deploy cmdlets are implemented as Microsoft PowerShell cmdlets and included in PowerCLI. Users of vSphere Auto Deploy cmdlets can take advantage of all PowerCLI features.
Experienced PowerShell users can use vSphere Auto Deploy cmdlets just like other PowerShell cmdlets. If you are new to PowerShell and PowerCLI, the following tips might be helpful.
You can type cmdlets, parameters, and parameter values in the PowerCLI shell.
- Get help for any cmdlet by running Get-Help
- Remember that PowerShell is not case sensitive.
- Use tab completion for cmdlet names and parameter names.
- Format any variable and cmdlet output by using Format-List or Format-Table, or their short forms fl or ft. For more information, run the Get-Help Format-List cmdlet.
Passing Parameters by Name
Copy-DeployRule -DeployRule testrule -ReplaceItem MyNewProfile
Most examples in the vCenter Server Installation and Setup documentation pass in parameters by name.
Passing Parameters as Objects
You can pass parameters as objects if you want to perform scripting and automation. Passing in parameters as objects is useful with cmdlets that return multiple objects and with cmdlets that return a single object. Consider the following example.
- Bind the object that encapsulates rule set compliance information for a host to a variable.
$tr = Test-DeployRuleSetCompliance MyEsxi42
- View the itemlist property of the object to see the difference between what is in the rule set and what the host is currently using.
- Remediate the host to use the revised rule set by using the Repair-DeployRuleSetCompliance cmdlet with the variable.
The example remediates the host the next time you boot the host.