I have a custom array stored as $REPORT3 that is sent as part of an HTML formatted email body using CovertTo-HTML. There may be instances when $REPORT3 is empty. Rather than just passing an e-mail body that is empty I wanted
to insert a text string indicating "no matching criteria".
$REPORT3 = @()
collect data to insert into $REPORT3
message body = $REPORT3 | ConvertTo-HTML
Now suppose $REPORT3.Length -eq 0, what value can I assign to $REPORT3 such that it can be converted to HTML and still work in the above framework? I tried $REPORT3 = "no matches" and $REPORT3 = "<html> no matches /<html>" if
array length is 0, but I get garbarge output from the HTML conversion (random numbers and and asterisk character).
Microsoft is conducting an online survey to understand your opinion of the Technet Web site. If you choose to participate, the online survey will be presented to you when you leave the Technet Web site.