Powershell: Get SHA256 Thumbprint from vCenter server using Powershell Core. (NSX-T Compute Manager Registration related)

Summary:
Had a need to pull a target vCenter's SSL certificate and convert it's thumbprint to SHA256 format to register to NSX-T Manager using Powershell core.  Servicepoint was not available in Core.

Noticed also recently Lam updated his approach to take Core into account.  My approach is slightly different and my script will also return the certificate object back if you so choose rather than just the SHA256 value.  Anyway, I've tested in PS Core 6.0.4 and 6.1 on Ubuntu, CentOS, and MacOS and my function seems to work fine.  Let me know if you see otherwise.

GIST below:

Microsoft Word for Mac: Bullets not formatting properly.



Summary:
Hard to quite describe, but I was working with an existing word doc and modifying some bulleted lists.  Needless to say, I was having some trouble w/ my normal methods of simply deleting a bullet and if it moved text to bullet above, hit enter to move it down.

This was not working.  Among other things it would reformat it in ways that just weren't working.  Found it that it had to do w/ "Track Changes" being enabled AND what seems to be 'too many' changes before they were accepted.

Workarounds:
Accept all changes
or
Turn off "Track Changes"

Either one works, but I still wanted to track changes, so I left it on and simply accepted all changes.  After doing so, working with bulleted lists worked fine.  Seems like a bug that needs to be addressed.  I have been running Office Insider Fast Track, so that MAY be part of the problem, but leaving this here for reference.

MS Word for Mac version 16.16.3


Powershell: PowerNSX: Refusing to load module.


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

PowerCLI: The SSL connection could not be established, see inner exception.




Summary:
Unable to connect to ESXi/vCenter server with Connect-VIserver cmdlet, get the following error:
"The SSL connection could not be established, see inner exception."

Be sure to "Set-PowerCLIConfiguration -InvalidCertificateAction:Ignore" if you plan to connect to an ESXi/vCenter that does not have trusted certificate.  Interestingly, something must've changed recently because the PowerCLI module actually would output a more descriptive message about setting your PowerCLIConfiguration.

This appears to be the case w/ Powershell Core 6.1.  I'm actually unsure when this behavior started happening and whether is module or powershell related.  Regardless, figured I'd post this since I was initially confused myself when running some things on another system.


Powershell: Making a RESTful API endpoint in powershell (kinda like python flask)

Summary:
While running scripts interactively and even on a scheduled basis is fine, I wanted to explore the possibility of making my scripts event-driven.  Take the vCheck Health Script for example.  Running that on a schedule is fine, but what if I wanted to run that on-demand?  Or other scripts in general?

The cool thing, you can do it all in Powershell Core!  Meaning, docker, linux, macOS, etc.  Basically, you can have this script run on OS startup (pre-populated with your endpoint configs/scripts) and you would have a Powershell driven REST-style API endpoint to run your scripts.

Here is the example, feel free to try it.  It'll do nothing of consequence on it's own.  I'll post later with a video on how to use it.