I have 2 scripts
script1 has the following:
$exportObject = New-Object System.Collections.ArrayList
$exportObject | Select-Object
in sc
Not sure what's going wrong for you. This works for me:
$Body = Get-ChildItem C:\Windows\ -File |
Select-Object -Property Name, Length, LastWriteTime -First 10 |
ConvertTo-Html -As Table -Head '' |
Out-String
Send-MailMessage -SmtpServer $SmtpServer -UseSsl -Subject $Subject -To $To -From $From -Body $Body -BodyAsHtml