Recently, PowerNSX was released to work with PowerShell Core. This was a substantial undertaking from Nick Bradford to submit some pull requests to PowerShell Core, create a new method of handling web requests, and then wholesale adjusting PowerNSX to work.
Now that this groundwork has been done PowerNSX can be added into the VMware docker image that contains PowerCLI core. William Lam detailed the container release here
docker run --rm -it --entrypoint='/usr/bin/powershell' vmware/powerclicore
This will allow docker to run the image
vmware/powerclicore and drop the current shell into the directory
To import PowerNSX run the command
import-module PowerNSX and you’re cooking with gas. Time to connect to my NSX Manager.
PS /powershell> Connect-NsxServer 192.168.120.25 -Username admin -Password default -DisableVIAutoConnect Version : 6.3.0 BuildNumber : 4637061 Credential : System.Management.Automation.PSCredential Server : 192.168.120.25 Port : 443 Protocol : https ValidateCertificate : False VIConnection : DebugLogging : False DebugLogFile : \[email protected]_01_04_02_16_00.log
And a quick command to verify everything is working as expected.
PS /powershell> Get-NsxSecurityTag | select name name ---- pester_st_testtag1
Now you can have PowerCLI and PowerNSX on any device any where. Happy days!