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 }}
Repository navigation
Get-MgUserMailFolderMessage : Syntax error: character '0' is not valid at position #402
I try to use the Microsoft.Graph Module to periodically search for specific mails in a mailbox.
When I filter the output with the "Search" parameter, the query breaks when I have characters like numbers or control characters.
Get-MgUserMailFolderMessage : Syntax error: character '0' is not valid at position 14 in 'Backup Config 0'.
In Zeile:1 Zeichen:1
+ Get-MgUserMailFolderMessage -UserId "mailbox@domain.tld" ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ UserId = back...ndProperty = }:<>f__AnonymousType5`10) [Get-MgUserMailFolderMessage_List], RestException`1
+ FullyQualifiedErrorId : RequestBroker--ParseUri,Microsoft.Graph.PowerShell.Cmdlets.GetMgUserMailFolderMessage_List
I am not sure if this behaviour is intended and I could not find any hints to that in the documentation.
However there are some workarounds to get the output i want, but therefore I have to first pull a huge list of mails and filter them afterwards, which is painfully slow
Activity
daveschafer commentedon Sep 25, 2020
Just found out my issue is tightly related to this one #399
If I quote my double quotes witha single quotes, everything works as expected, e.g.
Get-MgUserMailFolderMessage -UserId "mailbox@domain.tld" -MailFolderId "Inbox" -Search '"Backup Config 0"'Anyway, it would be nice if the SDK handled this behaviour
peombwa commentedon Dec 3, 2020
This has been fixed in version 1.2.0. Use
Update-Module Microsoft.Graphto install the latest version.