Fix if/else logic for pattern choice

In addition, overwrite existing file.
This commit is contained in:
2013-12-10 11:30:19 -05:00
parent 5210161d04
commit b5deea18d9

View File

@@ -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 = 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()