You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 2, 2019. It is now read-only.
$inbox = $gmail | Get-Mailbox
$inbox | Get-Message -Before "2014-11-30" ## This works fine.
$inbox | Get-Message -After "2014-11-30" ## This does not work.
Using -After gives us this error:
"Exception calling "Search" with "1" argument(s): "xm003 BAD Could not parse command"
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Gmail.ps\Gmail.ps.psm1:344 char:5
Using -On gives us this error:
GetRFC2060Date : Cannot process argument transformation on parameter 'date'. Cannot convert null to type "System.DateTime".
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Gmail.ps\Gmail.ps.psm1:276 char:44
It appears you have found the problem. Cannot process argument transformation on parameter 'date'. Cannot convert null to type "System.DateTime"
On line 275 of Gmail.ps\Gmail.ps.psm1
if ($On) { $imap += 'ON "' + $(GetRFC2060Date $After) + '"'
}
Notice that $After is passed instead of $On
This needs to be corrected.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I tried this on Powershell 2 and Powershell 4 on Windows Server 2008 and Windows 7 using different PCs.
This is a sample code:
$EmailUser = 'Test@GMail.Com'
$EmailUser2 = 'Test@Test.Com'
$EmailSubject = "isAlive"
$pw = [System.Convert]::FromBase64String("Base64Password")
$pw = [System.Text.Encoding]::UTF8.GetString($pw)
$secpasswd = ConvertTo-SecureString $pw -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential ($EmailUser, $secpasswd)
$gmail = New-GmailSession -Credential $mycreds
$inbox = $gmail | Get-Mailbox
$inbox | Get-Message -Before "2014-11-30" ## This works fine.
$inbox | Get-Message -After "2014-11-30" ## This does not work.
Using -After gives us this error:
"Exception calling "Search" with "1" argument(s): "xm003 BAD Could not parse command"
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Gmail.ps\Gmail.ps.psm1:344 char:5
"
Using -On gives us this error:
GetRFC2060Date : Cannot process argument transformation on parameter 'date'. Cannot convert null to type "System.DateTime".
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Gmail.ps\Gmail.ps.psm1:276 char:44
The text was updated successfully, but these errors were encountered: