Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $from = "D:\Program Files\ibm\cognos\tm1_64\cmplst.txt"
- $to = "C:\compare"
- Copy-Item $from $to -Recurse -Force
- $From = "xxx@gmail.com"
- $To = "xxxx@gmail.com"
- $Cc = "xxxx@gmail@gmail"
- $Subject = "String Comparison"
- $Body = (Compare-Object (Get-Content C:\compare\cmplst-1.txt) (Get-Content C:\compare\cmplst.txt) -includeequal).InputObject
- foreach($line in $comparison)
- {
- $Body+= $line
- }
- $SMTPServer = "smtp.gmail.com"
- $SMTPPort = "587"
- Send-MailMessage -From $From -to $To -Cc $Cc -Subject $Subject -Body $Body -SmtpServer $SMTPServer -port $SMTPPort -UseSsl -Credential xxx@gmail.comxxx(password og gmail)
- EOH
- "Cannot convert 'System.Object[]'
- to the
- type 'System.String' required by parameter 'Body'. Specified method is not supported"
Add Comment
Please, Sign In to add comment