添加"`r`n"不起作用

时间:2017-05-01 19:12:30

标签: powershell-v3.0

我无法为我出两个换行符。我有`r`n我想要的地方。

$fso = New-Object -Com Scripting.FileSystemObject
$folder = $fso.GetFolder("C:\test")

[string[]]$recipients = "toaddress"
$return = "`r`n"

$Subject = "GREEEN MOUNTAIN FILES ARE READY FOR UP LOAD FILES HAVE BEEN RECEIVED"  
$Body = "GREEN MOUNTAIN FILES ARE IN TO BE PROCESSED. If you don't send this file in by noon please contact team 17 if you"
$Body += " need to delay.If your files are not in by noon they will get processed the next day." + "`r`n"
$Body += " The number of invoices recevied are " + "`r`n"
$Body += "Regards,"
$Body += "COMMPANY"
$Body = $Subject + $Body + $filecounter + " " + $Body4 + $Body5 
$filecounter = @(Get-ChildItem c:\test).Count;

foreach ($f in $folder.files) {
    $fname = $folder.Name
    $fpath = $folder.FullName
    $fcount = Get-ChildItem $fpath |
              where {!$_.PSIsContainer} |
              Measure-Object |
              Select-Object -Expand Count
    $obj = New-Object psobject -Property @{
        FolderName = $fname;
        FolderPath = $fpath;
        FileCount  = $fcount
    }
    $output = $obj
    #Write-Host @(Get-ChildItem c:\test).Count;
}

Send-MailMessage -To "TOSOMEONE" -From "FROMSOMEONE" -Subject $Subject -Body $Body -BodyAsHtml -Priority High -Dno onSuccess, onFailure -SmtpServer MAILSERVER.com

0 个答案:

没有答案