Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot create a M365 group with an apostrophe / single quote in the display name with New-PnPMicrosoft365Group #4545

Open
1 of 6 tasks
lapin-b opened this issue Nov 12, 2024 · 1 comment
Labels
more info needed Further information is requested by user

Comments

@lapin-b
Copy link

lapin-b commented Nov 12, 2024

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:

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

  1. Authenticate to the tenant with Connect-PnPOnline (how precisely shouldn't matter)
  2. Invoke New-PnPMicrosoft365Group with a display name containing quotes
  3. 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?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : Azure Automation
@lapin-b lapin-b added the bug Something isn't working label Nov 12, 2024
@gautamdsheth
Copy link
Collaborator

@lapin-b - can you please try with the latest nightly builds and let us know, I couldn't reproduce it at my end ?

@gautamdsheth gautamdsheth added more info needed Further information is requested by user and removed bug Something isn't working labels Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info needed Further information is requested by user
Projects
None yet
Development

No branches or pull requests

2 participants