Passing Parameters by Name
You can pass in parameters by name in most cases and surround parameter values that contain spaces or
special characters with double quotes.
Copy-DeployRule -DeployRule testrule -ReplaceItem MyNewProfile
Most examples in the documentation pass in parameters by name.
Passing Parameters as Objects
You can pass parameters as objects if you want to do 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.
1
Bind the object that encapsulates rule set compliance information for a host to a variable.
$tr = Test-DeployRuleSetCompliance MyEsxi42
2
Display the
itemlist
property of the object to see the difference between what is in the rule set and
what the host is currently using.
$tr.itemlist
3
Remediate the host to use the revised rule set by passing the object to a call to
Repair-
DeployRuleSetCompliance
.
Repair-DeployRuleSetCompliance $tr
The example remediates the host the next time you boot the host.
Setting Properties to Support Remote Signing
For security reasons, Windows PowerShell supports an execution policy feature. It determines whether
scripts are allowed to run and whether they must be digitally signed. By default, the execution policy is set
to Restricted, which is the most secure policy. If you want to run scripts or load configuration files, you can
change the execution policy by using the
Set-ExecutionPolicy
cmdlet. To do this, type the following in the
vSphere PowerCLI console window.
Set-ExecutionPolicy RemoteSigned
If the command is successful, you can run scripts and load configuration files. For more information about
the execution policy and digital signing in Windows PowerShell, use the following command.
Get-Help About_Signing
Set Up Bulk Licensing
You can use the vSphere Web Client or ESXi Shell to specify individual license keys, or you can set up bulk
licensing by using PowerCLI cmdlets. Bulk licensing works for all ESXi hosts, but is especially useful for
hosts provisioned with Auto Deploy.
The following example assigns licenses to all hosts in a data center. You can also associate licenses with
hosts and clusters.
The following example is for advanced PowerCLI users who know how to use PowerShell variables.
Prerequisites
Install PowerCLI. See
“Install PowerCLI and Prerequisite Software,”
on page 170.
Chapter 7 Installing ESXi
VMware, Inc.
171
Summary of Contents for VS4-ENT-PL-A - vSphere Enterprise Plus
Page 6: ...vSphere Installation and Setup 6 VMware Inc ...
Page 8: ...vSphere Installation and Setup 8 VMware Inc ...
Page 10: ...vSphere Installation and Setup 10 VMware Inc ...
Page 28: ...vSphere Installation and Setup 28 VMware Inc ...
Page 70: ...vSphere Installation and Setup 70 VMware Inc ...
Page 100: ...vSphere Installation and Setup 100 VMware Inc ...
Page 122: ...vSphere Installation and Setup 122 VMware Inc ...
Page 138: ...vSphere Installation and Setup 138 VMware Inc ...