diff --git a/blink1/new-mail.ps1 b/blink1/new-mail.ps1 index 8a68a47..c00bfe6 100644 --- a/blink1/new-mail.ps1 +++ b/blink1/new-mail.ps1 @@ -1,6 +1,9 @@ $outlook = New-Object -com Outlook.Application $inbox = $outlook.Session.GetDefaultFolder(6) -$stream = [System.IO.StreamWriter] "d:\blink-new-mail-temp.txt" -if ($inbox.UnReadItemCount -eq 0) { $stream.WriteLine("#000000") } -$stream.WriteLine("pattern: ""NewMail""") +$stream = New-Object 'System.IO.StreamWriter' -ArgumentList "d:\blink-new-mail-temp.txt", $false +if ($inbox.UnReadItemCount -eq 0) { + $stream.WriteLine("#000000") +} else { + $stream.WriteLine("pattern: ""NewMail""") +} $stream.close() \ No newline at end of file