Information Technology Reference
In-Depth Information
4. To verify the setting, use the Get-ExecutionPolicy cmdlet:
Get-ExecutionPolicy
The Get-ExecutionPolicy cmdlet should return RemoteSigned.
5. Ty p e Exit and press Enter to close the PowerCLI/PowerShell session.
Now when you relaunch PowerCLI, you are greeted with several excellent starting cmdlets,
such as Connect-VIServer, Get-VIcommand, and Get-PowerCLIHelp (Figure 14.3). These sug-
gestions are important, especially since Connect-VIServer is a required i rst cmdlet for con-
necting to your virtual infrastructure. You're now ready to get started with PowerCLI!
Figure 14.3
h e PowerCLI
startup screen
provides quick tips
on a few useful
commands.
PowerShell Script Execution Policy
h e PowerShell script execution policy allows you to manage which scripts can be run on your
computer. By default, PowerShell is run as Restricted , which means that no scripts can be run and
PowerShell can run only in interactive console mode. h is also includes PowerCLI. h e recommended
setting is RemoteSigned , which allows scripts that you write as well as those signed by a trusted
publisher, such as VMware. You will likely see recommendations to set the execution policy to
Unrestricted , which will allow you to run all Windows PowerShell/PowerCLI scripts. h is certainly
makes things easier for troubleshooting, but you should consider the security of the system before
setting the execution policy to Unrestricted. Unrestricted allows even malicious scripts to run.
You can learn more about PowerShell script execution policies by entering the following into a
PowerShell/PowerCLI console:
get-help about_Execution_Policies
Additional PowerCLI Capabilities
VMware has also released a variety of other PowerShell snap-ins to work alongside PowerCLI
to manage vSphere environments. Snap-ins for Auto Deploy, Image Builder, Licensing, and the
new VDS capabilities are included during the core PowerCLI 5.5 installation. You'll note during
Search WWH ::




Custom Search