Several bugs in the script:
Line 721: replace with
if ($IISLogs.Count -gt 1) {
Also I suggest to delcare IISLogs with type [String[]] rather than [array] (line 48); this makes the script deal better with passed array of paths.
In Create-HTML, around line 593-602 - the function works but this is somehow by chance :) :
Replace
>>
$html = ConvertTo-HTML -Head $HTMLHeader -Body $body
$body = "<h2><TT>Exchange ActiveSync Report on $title<TT></h2><TT>For additional <b>unfiltered</b> information on device hits please refer to the CSV $outfile</TT><BR /><BR />"
if ($table.count -le 0) {
$body += "No Devices have excited the Minimum Number of Hits (<b>$MinimumHits</b>)"
}
else { $body += ($table | Select $HTMLCSVHeaders.split(",") | ConvertTo-HTML -Fragment) }
$body += "</body></html>"
return ($HTMLHeader += $body)
<<
with
>>
$body = "<h2><TT>Exchange ActiveSync Report on $title<TT></h2><TT>For additional <b>unfiltered</b> information on device hits please refer to the CSV $outfile</TT><BR /><BR />"
if ($table.count -le 0) {
$body += "No Devices have excited the Minimum Number of Hits (<b>$MinimumHits</b>)"
}
else { $body += ($table | Select $HTMLCSVHeaders.split(",") | ConvertTo-HTML -Fragment) }
$body += "</body></html>"
ConvertTo-HTML -Head $HTMLHeader -Body $body
<<