VMware NSX has an open API and it’s pretty easy to consume. PowerShell is the same way; it’s easy to learn and easy to extend. This week, Anthony Burke and Nick Bradford released a PowerShell extension called PowerNSX. As the name suggests, it’s all about managing VMware NSX.

Nick and Anthony put PowerNSX on Bitbucket, which means there will be a continuos release cycle (whenever someone pushes something to the Git repository). You can download and install PowerNSX using Git or by downloading the branch as a zipfile.

Prerequisites

To run PowerNSX, you need a couple of things pre-installed on your machine. PowerShell v3+, .NET 4.5+, PowerCLI and the PowerNSX Module. The good news is that PowerNSX provides an installer script that you can use to use to install all of those at once. It’s as easy as executing the installer script, on which it will look for the prerequisites and only download and install the packages that are not installed yet. Here’s what it does:

powernsx-installation

Using PowerNSX

After installing the PowerNSX module, you can start using the NSX commandlets. Firstly include the PowerCLI Snap-in, then load the PowerNSX module and connect to your NSX Manager.

The vCenter configuration is automatically detected from the settings on the NSX Manager and a connection is made to make it easier for PowerNSX to work with vCenter objects such as virtual machines, clusters, dvs, etc.

Examples

When you’re connected to both the NSX Manager and vCenter, you can start doing all kinds of fun stuff. For instance, getting all the NSX Logical Switches in object form:

Or creating and removing Logical Switches:

Conclusion

If you are working with VMware NSX, then PowerNSX should definitely be in your toolbox. It’ll make your life a lot easier and make configuring NSX faster. Go get it!