Loving what I have seen so far, but can't get the HTML TOC portion to work. Keep getting this error message
Exception calling "write" with "1" argument(s): "Type mismatch.
"
At C:\users\jwiggins\scratch\RecurringADChecks\RecurringADChecks.ps1:159 char:1
+ $HTMLObject.write([System.Text.Encoding]::Unicode.GetBytes($HTMLRepor ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : COMException
any ideas?