5.5.2
Table Of Contents
- Using VMware vCenter Orchestrator Plug-Ins
- Contents
- Using VMware vCenter Orchestrator Plug-Ins
- Introduction to Orchestrator Plug-Ins
- Configure the Orchestrator Plug-Ins
- Using the vCenter Server Plug-In
- Configuring the vCenter Server Plug-In
- vCenter Server Plug-In Scripting API
- Using the vCenter Server Plug-In Inventory
- Access the vCenter Server Plug-In Workflow Library
- vCenter Server Plug-In Workflow Library
- Batch Workflows
- Cluster and Compute Resource Workflows
- Custom Attributes Workflows
- Datacenter Workflows
- Datastore and Files Workflows
- Datacenter Folder Management Workflows
- Host Folder Management Workflows
- Virtual Machine Folder Management Workflows
- Guest Operation Files Workflows
- Guest Operation Processes Workflows
- Power Host Management Workflows
- Basic Host Management Workflows
- Host Registration Management Workflows
- Networking Workflows
- Distributed Virtual Port Group Workflows
- Distributed Virtual Switch Workflows
- Standard Virtual Switch Workflows
- Resource Pool Workflows
- Storage Workflows
- Storage DRS Workflows
- Basic Virtual Machine Management Workflows
- Clone Workflows
- Linked Clone Workflows
- Linux Customization Clone Workflows
- Tools Clone Workflows
- Windows Customization Clone Workflows
- Device Management Workflows
- Move and Migrate Workflows
- Other Workflows
- Power Management Workflows
- Snapshot Workflows
- VMware Tools Workflows
- Using the Configuration Plug-In
- Using the vCO Library Plug-In
- Using the SQL Plug-In
- Using the SSH Plug-In
- Using the XML Plug-In
- Using the Mail Plug-In
- Using the Net Plug-In
- Using the Enumeration Plug-In
- Using the Workflow Documentation Plug-In
- Using the HTTP-REST Plug-In
- Using the SOAP Plug-In
- Using the AMQP Plug-In
- Using the SNMP Plug-In
- Using the Active Directory Plug-In
- Using the Dynamic Types Plug-In
- Configuring and Using the Multi-Node Plug-In
- Using the PowerShell Plug-In
- Using the PowerShell Plug-In Inventory
- Configuring the PowerShell Plug-In
- Running PowerShell Scripts
- Generating Actions
- Passing Invocation Results Between Actions
- PowerCLI Integration with the PowerShell Plug-In
- Sample Workflows
- Access the PowerShell Plug-In API
- Working with PowerShell Results
- Examples of Scripts for Common PowerShell Tasks
- Troubleshooting
- Index
Workflow Name Description
Toggle virtual machine state Toggles the power state of a virtual machine.
Access the PowerShell Plug-In API
Orchestrator provides an API Explorer to allow you to search the PowerShell plug-in API and see the
documentation for JavaScript objects that you can use in scripted elements.
Procedure
1 Log in to the Orchestrator client as an administrator.
2 Access the API Explorer from either the Orchestrator client or from the Scripting tabs of the workflow,
policy, and action editors.
n
To access the API Explorer from the Orchestrator client, click Tools > API Explorer in the
Orchestrator client toolbar.
n
To access the API Explorer from the Scripting tabs of the workflow, policy, and action editors, click
Search API on the left.
3 To expand the hierarchical list of PowerShell plug-in API objects, double-click the PowerShell module
in the left pane.
What to do next
You can copy code from API elements and paste it into scripting boxes. For more information about API
scripting, see Developing with VMware vCenter Orchestrator.
Working with PowerShell Results
You can use objects from the API of the PowerShell plug-in to work with results that Windows PowerShell
returns.
You can use the methods from the PowerShellInvocationResult class to get information about a script that
you run.
Method Description
getErrors()
Returns a list of errors reported by the PowerShell engine during script invocation.
getInvocationState() Status of the script. The possible values are Completed or Failed.
getHostOutput()
Output of the script as it appears on the PowerShell console.
getResults()
Objects returned by the PowerShell engine. The returned object is of type
PowershellRemotePSObject.
PowershellRemotePSObject is a remote representation of objects returned by the PowerShell engine.
PowershellRemotePSObject contains XML serialization of the result that can be accessed by calling the
getXml() method.
The PowerShell plug-in also provides an object model that wraps the XML result and provides easier access
to particular object properties. The getRootObject() method provides access to the object model. In general,
the getRootObject() method maps the PowerShell types to types available in Orchestrator, by using the
following rules.
n
If the returned object is of a primitive PowerShell type, the object is mapped to the corresponding
Orchestrator primitive type.
n
If the returned object is of type collection, the object is represented as ArrayList.
n
If the returned object is of type dictionary, the object is represented as Hashtable.
Using VMware vCenter Orchestrator Plug-Ins
124 VMware, Inc.