Gmail.ps icon indicating copy to clipboard operation
Gmail.ps copied to clipboard

Get-Message doesn't work without any optional parameters

Open absolutejam opened this issue 9 years ago • 0 comments

Would it make sense to have sensible defaults of $imap = @('SEEN','UNSEEN') if no other parameters are specified (I assume this will return all messages)?.

I can add a PR if that's a reasonable way to go about it.

The full exception:

PS C:\Users\administrator> $Session | Get-Mailbox 'Inbox' | Get-Message
Exception calling "Search" with "1" argument(s): "xm003 BAD Could not parse command"
At C:\Users\administrator\Documents\WindowsPowerShell\Modules\Gmail.ps\Gmail.ps.psm1:344 char:5
+     $result = $Session.Search('(' + $criteria + ')');
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : Exception

absolutejam avatar Feb 09 '16 20:02 absolutejam

As I mentioned in other issue, use a pull request to add this feature.

DougHennig avatar Feb 02 '22 22:02 DougHennig