You can manage the NSX Policy API with VMware PowerCLI by using the NSX Policy SDK for PowerShell.

How Does the NSX Policy SDK for PowerShell Work

Starting from VMware PowerCLI 12.6, you can use the NSX Policy SDK for PowerShell to communicate with all available NSX Policy REST APIs.

The VMware.Sdk.Nsx.Policy module contains SDK cmdlets that are automatically generated and provide PowerShell bindings to the NSX REST APIs. The PowerCLINSX module functions on a low level and communicates directly with the NSX Policy API server.

You can construct NSX Policy 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 NSX Policy SDK Cmdlets
You construct NSX Policy SDK cmdlets 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 NSX Policy API server and invoke the operations.