30 Host/20 ESXi with Technical Support mode enabled.ps1
TechSuportModeEnabled is boolean and must be compared to a boolean rather than a string. All non-empty strings evaluate to $true; including "True" and "False".
Corrected spelling to TechSupportModeEnabled.
Combined the first two Where-Objects of the second collection the same way it is done in the first.
Combined the ConnectionState tests with -in rather than -and.
30 Host/20 ESXi with Technical Support mode enabled.ps1
TechSuportModeEnabled is boolean and must be compared to a boolean rather than a string. All non-empty strings evaluate to $true; including "True" and "False".
Corrected spelling to TechSupportModeEnabled.
Combined the first two Where-Objects of the second collection the same way it is done in the first.
Combined the ConnectionState tests with -in rather than -and.
Added line breaks for readability.