Issue similar to #4169 where quotes are not properly accounted for in the query.
Expected behavior
When the cmdlet is invoked with a group display name containing an apostrophe / single quote, the M365 group is not created and the cmdlet errors out with the following message instead:
New-PnPMicrosoft365Group:
Line |
98 | $group = New-PnPMicrosoft365Group -DisplayName $teamName -Description …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Bad Request (400): Invalid filter clause: ')' or operator expected at position 69 in 'groupTypes/any(c:c eq 'Unified') and (displayName eq 'L'apostrophe' or mailNickName eq 'L'apostrophe')'.
(I replaced the actual group name with a dummy one, the position might not be exact)
Actual behavior
I would expect a successful run and the creation of a M365 group with a Microsoft Teams team associated (flag -CreateTeam).
Steps to reproduce behavior
Authenticate to the tenant with Connect-PnPOnline (how precisely shouldn't matter)
Invoke New-PnPMicrosoft365Group with a display name containing quotes
See the HTTP 400 Bad Request error being reported
What is the version of the Cmdlet module you are running?
PnP.PowerShell version 2.12.0 on PowerShell 7.2
Which operating system/environment are you running PnP PowerShell on?
Reporting an Issue or Missing Feature
Issue similar to #4169 where quotes are not properly accounted for in the query.
Expected behavior
When the cmdlet is invoked with a group display name containing an apostrophe / single quote, the M365 group is not created and the cmdlet errors out with the following message instead:
(I replaced the actual group name with a dummy one, the position might not be exact)
Actual behavior
I would expect a successful run and the creation of a M365 group with a Microsoft Teams team associated (flag
-CreateTeam
).Steps to reproduce behavior
Connect-PnPOnline
(how precisely shouldn't matter)New-PnPMicrosoft365Group
with a display name containing quotesWhat is the version of the Cmdlet module you are running?
PnP.PowerShell version 2.12.0 on PowerShell 7.2
Which operating system/environment are you running PnP PowerShell on?