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
Cannot use KQL in Get-MgSite (PowerShell 7 only) #419
Error message returned in 7 is "Syntax error: character ':' is not valid at position 7 in 'GroupId:76493310-6708-48a9-a4dc-d36e7a239ff1'". Fiddler shows that PowerShell 7 URL-encodes the value in -Search:
Error:
$messages = Get-MgUserMessage -UserId $user -Search $searchString #`" …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Syntax error: character ':' is not valid at position 13 in 'Weekly digest: Office 365 changes'.
In order to fix it i had to use double quotes and escape them as follows:
This won't fly for the /sites endpoint with ?search. ?search always works with KQL and ?$search does not. This issue was opened for a SharePoint-specific reason.
Activity
[-]Cannot use KQL in Get-MgSite[/-][+]Cannot use KQL in Get-MgSite (PowerShell 7 only)[/+]ATJSM commentedon Oct 8, 2020
I was experiencing a very similar issue with the Search switch in PowerShell 7.0.2.
Error:
$messages = Get-MgUserMessage -UserId $user -Search $searchString #`" …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Syntax error: character ':' is not valid at position 13 in 'Weekly digest: Office 365 changes'.
In order to fix it i had to use double quotes and escape them as follows:
peombwa commentedon Oct 21, 2020
This is indeed a client bug and is being tracked by #399. A workaround for now is to double quote your -Search value as mentioned by ATJSM .
joshtransient commentedon Nov 23, 2020
This won't fly for the /sites endpoint with ?search. ?search always works with KQL and ?$search does not. This issue was opened for a SharePoint-specific reason.