VCF PowerCLI 9.0 now includes a module called VMware.Sdk.Nsx.Policy, this modules contains auto-generated cmdlets to support NSX Policy Public APIs. Use can use this post as a quick reference guide.
Connecting to a NSX Instance with Local Credentials
-
Start a PowerShell session.
-
Connect to a NSX instance using local credentials by running the following command:
Connect-NsxServer -Server sfo-m01-nsx01.sfo.rainpole.io -User admin -Password VMw@re1!VMw@re1!
- Once connected the following information is stored in
$defaultNsxConnections.
ServiceUri : https://sfo-m01-nsx01.sfo.rainpole.io/
SessionSecret :
User : admin
IsConnected : True
Id : /NsxServer=admin@sfo-m01-nsx01.sfo.rainpole.io:443/
Name : sfo-m01-nsx01.sfo.rainpole.io
Uid : /NsxServer=admin@sfo-m01-nsx01.sfo.rainpole.io:443/
ProductVersion : 9.0.0.0.24705144
ServerUri : https://sfo-m01-nsx01.sfo.rainpole.io/
UUID : /NsxServer=admin@sfo-m01-nsx01.sfo.rainpole.io:443/
Port : 443
- Disconnect from a NSX instance by running the following command:
Disconnect-NsxServer -Server sfo-m01-nsx01.sfo.rainpole.io
NOTE
The VMware.Sdk.Nsx.Policy module contains a lot of cmdlets which do not display well in a blog post so for this module you can view the commands within relevant text files located on my GitHub repository.
Display All NSX GET Command Details
-
Start a PowerShell session.
-
Display all GET cmdlets supported in
VMware.Sdk.Nsx.Policyby running the following command:
Get-NsxOperation -Method Get | Select-Object CommandInfo, Path, Method
- To view the output for all GET cmdlets in
VMware.Sdk.Nsx.Policysee VMware.Sdk.Nsx.Policy.GET.txt.
Display All NSX POST Command Details
-
Start a PowerShell session.
-
Display all POST cmdlets supported in
VMware.Sdk.Nsx.Policyby running the following command:
Get-NsxOperation -Method Post | Select-Object CommandInfo, Path, Method
- To view the output for all POST cmdlets in
VMware.Sdk.Nsx.Policysee VMware.Sdk.Nsx.Policy.POST.txt.
Display All NSX PUT Command Details
-
Start a PowerShell session.
-
Display all PUT cmdlets supported in
VMware.Sdk.Nsx.Policyby running the following command:
Get-NsxOperation -Method Put | Select-Object CommandInfo, Path, Method
- To view the output for all PUT cmdlets in
VMware.Sdk.Nsx.Policysee VMware.Sdk.Nsx.Policy.PUT.txt.
Display All NSX PATCH Command Details
-
Start a PowerShell session.
-
Display all PATCH cmdlets supported in
VMware.Sdk.Nsx.Policyby running the following command:
Get-NsxOperation -Method Patch | Select-Object CommandInfo, Path, Method
- To view the output for all PATCH cmdlets in
VMware.Sdk.Nsx.Policysee VMware.Sdk.Nsx.Policy.PATCH.txt.
Display All NSX DELETE Command Details
- Start a PowerShell session.
- Display all DELETE cmdlets supported in
VMware.Sdk.Nsx.Policyby running the following command:
Get-NsxOperation -Method Delete | Select-Object CommandInfo, Path, Method
- To view the output for all DELETE cmdlets in
VMware.Sdk.Nsx.Policysee VMware.Sdk.Nsx.Policy.DELETE.txt.

Leave a reply to VCF PowerCLI 9.0: Understanding PowerCLI SDK Cmdlets – MY CLOUDY WORLD Cancel reply