Guest User

Untitled

a guest
Jan 1st, 2018
637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. $from = "D:\Program Files\ibm\cognos\tm1_64\cmplst.txt"
  2. $to = "C:\compare"
  3. Copy-Item $from $to -Recurse -Force
  4. $From = "xxx@gmail.com"
  5. $To = "xxxx@gmail.com"
  6. $Cc = "xxxx@gmail@gmail"
  7. $Subject = "String Comparison"
  8. $Body = (Compare-Object (Get-Content C:\compare\cmplst-1.txt) (Get-Content C:\compare\cmplst.txt) -includeequal).InputObject
  9. foreach($line in $comparison)
  10. {
  11. $Body+= $line
  12. }
  13. $SMTPServer = "smtp.gmail.com"
  14. $SMTPPort = "587"
  15. Send-MailMessage -From $From -to $To -Cc $Cc -Subject $Subject -Body $Body -SmtpServer $SMTPServer -port $SMTPPort -UseSsl -Credential xxx@gmail.comxxx(password og gmail)
  16. EOH
  17.  
  18. "Cannot convert 'System.Object[]'
  19. to the
  20. type 'System.String' required by parameter 'Body'. Specified method is not supported"
Add Comment
Please, Sign In to add comment