Posts

Showing posts with the label PowerNSX

Powershell: NSX-V Edge Service Gateway (ESG) Firewall Rules Output

Image
Summary: Basically had a script to output Distributed Firewall, but not individual ESG based firewall rules.  Turns out, I could re-use some of what I had made for DFW , but had to rewrite ALOT surprisingly.  So here is an ESG based version.  The script was written and run using Powershell 7 Core, latest PowerCLI and PowerNSX. It might work on other revisions, but I'm too lazy to back test.  You can export to CSV as well.

Powershell: PowerNSX: Refusing to load module.

Image
Summary: "The PowerShell Core Beta has known issues that cause PowerNSX to fail.  Refusing to load module." Basically, this happens when you upgrade powershell to 6.1.x.  It's related to a bad section of code in the module that checks for beta releases that should probably deprecated or taken out. Workaround: Modify line 82 to read as such: if ( ( $script:PNsxPSTarget -eq "Core" ) -and ( $PSVersionTable.GitCommitId -notmatch '^v6.[\d].[\d]+$|6.[\d].[\d]+$') ) { Or Comment out line 82 through 90 to remove the check entirely. Details: The check appears to happen because the GitCommitId format may have changed from 6.0 to 6.1 where it was prepended with a v in 6.0 whereas in 6.1 it is not longer prepended. Links: https://github.com/vmware/powernsx/issues/557

VMware: PowerNSX on Mac Invoke-nsxwebrequest unknown exception

Image
Blarg! Summary: All was well and dandy until I tried to actually "do" something.  I was trying to create a new logical switch (New-NSXLogicalSwitch) when these errors reared their ugly head: https://github.com/vmware/powernsx/issues/493 One or more errors occurred. (The handler does not support custom handling of certificates with this combination of libcurl (7.54.0) and its SSL backend ("LibreSSL/2.0.20").) ---> System.PlatformNotSupportedException: The handler does not support custom handling of certificates with this combination of libcurl (7.54.0) and its SSL backend ("LibreSSL/2.0.20"). Workaround: Windows w/ full Powershell does not have these issues.  Have yet to see if it is a thing specific to Powershell Core.  So use it if you can. If you don't have a Windows box handy, you can modify the PowerNSX.psm module file to get around this error.  I'm unsure if it can become a permanent solution, but it effectively accomplishes the...