Skip to content

Commit

Permalink
Corrected errors affecting in Get-Message (-On, -After, Read and Unread)
Browse files Browse the repository at this point in the history
  • Loading branch information
koladei committed Mar 19, 2016
1 parent 35cb67d commit 1e63ced
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Gmail.ps.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ function Get-Message {
}

if ($On) {
$imap += 'ON "' + $(GetRFC2060Date $After) + '"'
$imap += 'ON "' + $(GetRFC2060Date $On) + '"'
}

if ($From) {
Expand All @@ -285,11 +285,11 @@ function Get-Message {
}

if ($After) {
$imap += 'AFTER "' + $(GetRFC2060Date $After) + '"'
$imap += 'SENTSINCE "' + $(GetRFC2060Date $After) + '"'
}

if ($Before) {
$imap += 'BEFORE "' + $(GetRFC2060Date $Before) + '"'
$imap += 'SENTBEFORE "' + $(GetRFC2060Date $Before) + '"'
}

if ($Cc) {
Expand Down Expand Up @@ -331,7 +331,7 @@ function Get-Message {
if ($imap.Length -gt 0) {
$criteria = ($imap -join ') (')
}

if ($xgm.Length -gt 0) {
$gmcr = 'X-GM-RAW "' + ($xgm -join ' ') + '"'
if ($imap.Length -gt 0) {
Expand All @@ -340,8 +340,8 @@ function Get-Message {
$criteria = $gmcr
}
}

$result = $Session.Search('(' + $criteria + ')');
$result = $Session.Search("($criteria)");
$i = 1

foreach ($item in $result) {
Expand Down

0 comments on commit 1e63ced

Please sign in to comment.