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] New-PnPMicrosoft365Group Throws Error in PreRelease 1.11.74 #2346

Closed
1 of 6 tasks
Studermarc opened this issue Sep 14, 2022 · 2 comments
Closed
1 of 6 tasks

[BUG] New-PnPMicrosoft365Group Throws Error in PreRelease 1.11.74 #2346

Studermarc opened this issue Sep 14, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@Studermarc
Copy link
Contributor

Studermarc commented Sep 14, 2022

Reporting an Issue or Missing Feature

New-PnPMicrosoft365Group Cmdlet fails in the new PreRelease with -ErrorAction = "Stop"

Expected behavior

A new Microsoft 365 Group is created

Actual behavior

An Error is thrown

Looking at the codebase, the Error gets thrown when it first checks, if a Microsoft 365 Group with the same alias exists (because none is found, which is to be excepted):

I believe the error thrown when no teams is found should be suppressed, as we actually check for its non-existance, and not the oposite:

var candidate = Microsoft365GroupsUtility.GetGroupAsync(Connection, MailNickname, AccessToken, false, false).GetAwaiter().GetResult();

The Error is thrown due to the changes made to the Error Handling Behaviour: #2288 (comment)

Steps to reproduce behavior

  1. Run the following Code
New-PnPMicrosoft365Group -DisplayName "TestNewGroup" -Description "TestNewGroup" -MailNickname "TestNewGroup" -Connection $AdminConnection
  1. Observe the Error:
New-PnPMicrosoft365Group: No Microsoft 365 group found with id, display name or mail nickname 'TestNewGroup'

What is the version of the Cmdlet module you are running?

1.11.74

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify
@gautamdsheth
Copy link
Collaborator

Hi @Studermarc , good catch.
Have managed to fix it. The fix will be available in tomorrow's nightly.

Please let me know if the issue still persists.

@Studermarc
Copy link
Contributor Author

Awesome many thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants