Integration

Table Of Contents
VMware, Inc. 33
Chapter 3 Using View PowerCLI
Error Handling
View PowerCLI cmdlets handle all errors as non-terminating errors that halt the execution of a cmdlet but do
not terminate a pipeline. You can examine the $error automatic variable to determine the nature of an error.
You can set the standard PowerShell $ErrorActionPreference and $errorView automatic variables to
control how PowerShell handles non-terminating errors and how it displays them in the shell.
Error When Piping and Specifying Objects at the Same Time
If you attempt to pipe an object into a cmdlet and specify an object of the same type to that cmdlet, the cmdlet
fails with the following error.
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.
For example, the following cmdlet usage would produce this error.
Get-Pool -pool_id Pool1 | Update-ManualPool -pool_id Pool2 -displayName “Manual Pool 2”
Escaping Characters in vCenter Path Names
If you specify a path to a vCenter folder that includes certain special characters in the name of an entity, you
must escape these characters. Table 3-1 shows the escape sequences for special characters.
Do not escape the slashes in the path name itself. For example, you would represent the path to the folder
/datacenter_01/vm/img%-12 as /datacenter_01/vm/img%25-12.
Table 3-2 lists the cmdlets and parameters that require you to use escape sequences in entity names.
Table 3-1. Escape Sequences for Special Characters
Special Character Escape Sequence
%%25
/%2f
\%5c
Table 3-2. Cmdlet Parameters Requiring Escape Sequences
Cmdlet Parameters Requiring Escape Sequences
Add-AutomaticLinkedClonePool
Update-AutomaticLinkedClonePool
-datastoreSpecs
-parentVMPath
-resourcePoolPath
-vmfolderPath
Add-AutomaticPool
Update-AutomaticPool
-datastorePaths
-resourcePoolPath
-templatePath
-vmfolderPath
Send-LinkedCloneRecompose -parentVMPath