Skip to content

[BUG]Connect-PnPOnline has a memory leak #1247

@Ambergahill

Description

@Ambergahill

Expected behavior

I should be able to run Connect-PnPOnline thousands of times in a row for different SPO URLs without a System.OutOfMemoryException.

Actual behavior

After about 900 to 1,000 times of calling Connect-PnPOnline, I get a System.OutOfMemoryException.

Steps to reproduce behavior

-Create a loop that iterates through 1,000+ valid SPO URLs. (You may be able to cycle through repeat URLs if you don't have 1,000)
-Connect-PnpOnline to each one of the URLs. For me, I am using certificatePath -ClientId -CertificatePassword along with -Tenant and -Url properties.
-Your loop doesn't have to do anything else, but connect. I also tried using Disconnect-PnPOnline afterwards with no luck. Based off of this article (https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/disconnect-pnponline?view=sharepoint-ps), that shouldn't be needed anyway.

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

1.7.0

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

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions