4.6

Table Of Contents
VMware View Integration
30 VMware, Inc.
Start the PowerShell Console with View PowerCLI Loaded
YoucanruntheViewPowerCLIcmdletsdirectlyonaViewConnectionsServerhostthathasthefollowing
softwareinstalled.
VMwareView4.5orlater
Microsoft.NETframework
WindowsPowerShell1.0
TousetheViewPowerCLIcmdletstochangetheconfigurationofView,youmustbeloggedintoaView
ConnectionServerinstanceasauserinarolewithsufficientprivileges,suchastheAdministratorsrole.Ifyour
roleisareadonlyrole,youcannotupdateconfiguration
data.Formoreinformation,seetheVMwareVi e w
Administrationdocument.
To start the PowerShell console with View PowerCLI loaded
1 SelectStart>AllPrograms>VMware >ViewPowerCLI.
2Ifyouseeanerrormessagestatingthatthescriptconfigurationfilecannotbeloadedbecausethe
executionofscriptsisdisabled,typethefollowingPowerShellcommandandrestartthePowerShell
console.
Set-ExecutionPolicy Unrestricted
Displaying Help for a View PowerCLI cmdlet
TolistallViewPowerCLIcmdlets,typethiscommandinthePowerShellconsole.
Get-Command -PSSnapin VMware.View.Broker | more
YoucangethelpforaspecificcmdletbyusingtheGet-HelpcmdletinthePowerShellconsole.Forexample,
togethelpontheAdd-ViewVCcmdlet.
Get-Help Add-ViewVC | more
Formoredetailedinformation,addthe-fullparameter.
Get-Help Add-ViewVC -full | more
Alternatively,youcanusethe
helpaliasforGet-Help.
help Add-ViewVC -full | more
Error Handling
ViewPowerCLIcmdletshandleallerrorsasnonterminatingerrorsthathalttheexecutionofacmdletbutdo
notterminateapipeline.Youcanexaminethe$errorautomaticvariabletodeterminethenatureofanerror.
YoucansetthestandardPowerShell$ErrorActionPreferenceand$errorViewautomaticvariablesto
controlhow
PowerShellhandlesnonterminatingerrorsandhowitdisplaysthemintheshell.
Error When Piping and Specifying Objects at the Same Time
Ifyouattempttopipeanobjectintoacmdletandspecifyanobjectofthesametypetothatcmdlet,thecmdlet
failswiththefollowingerror.
The input object cannot be bound to any parameters for the command either because the command
does not take pipeline input or the input and its properties do not match any of the parameters
that take pipeline input.
Forexample,thefollowingcmdletusagewouldproducethiserror.
Get-Pool -pool_id Pool1 | Update-ManualPool -pool_id Pool2 -displayName “Manual Pool 2”