Understanding the vSphere Automation SDK for PowerShell

You can manage the vSphere Automation API with VMware PowerCLI by using the vSphere Automation SDK for PowerShell.

The vSphere Automation SDK is integrated in VMware PowerCLI, starting from version 12.4.0. The modules that contain the vSphere Automation SDK start with the VMware.vSphere.Sdk prefix.

The vSphere Automation SDK functions on a low level and communicates directly with the vSphere Automation API server. The results from the API operations are returned as PowerShell custom objects.

You can construct vSphere Automation SDK cmdlets by using the Initialize- and Invoke- cmdlet verbs in combination with the names of the API data structures or operations.

Figure 1. Constructing vSphere Automation SDK Cmdlets
You construct vSphere Automation SDK commandlets by using the Initialize and Invoke cmdlet verbs and adding an API data structure or operation.
  • Use Initialize- cmdlets to prepare the data structures, if any, for your API calls. These cmdlets function on the client side and do not communicate with the API server.

  • Use Invoke- cmdlets to call the vSphere Automation API server and invoke the operations.

Get Help with the vSphere Automation SDK Cmdlets

To get help in PowerShell, use the Get-Help cmdlet in combination with a vSphere Automation SDK cmdlet name. Add the -Online parameter to the command and the system directs you to the vSphere Automation API reference website.

Get-Help Invoke-CreateVM -Online

Get vSphere Automation SDK Code Samples

The vSphere Automation API Reference on VMware Developer features ready-to-use vSphere Automation SDK code samples that you can paste directly into PowerShell. The snippets are called PowerCLI Client SDK Examples and are nested in the Code Samples section for each operation.