Skip to content

Collection was modified; enumeration operation may not execute. #1657

Description

@wboyd-aw

Describe the Bug

Category: NotSpecified: (:) [ConvertTo-Json], InvalidOperationException
Message: Collection was modified; enumeration operation may not execute.
StackTrace: at Test-PodeSessionDataHash, C:\git\AwPwshDashboard\src\ps_modules\Pode\2.12.1\Private\Sessions.ps1: line 165
at Save-PodeSessionInternal, C:\git\AwPwshDashboard\src\ps_modules\Pode\2.12.1\Private\Sessions.ps1: line 181
at Save-PodeSession, C:\git\AwPwshDashboard\src\ps_modules\Pode\2.12.1\Public\Sessions.ps1: line 236
at <ScriptBlock>, C:\git\AwPwshDashboard\src\ps_modules\Pode\2.12.1\Private\Sessions.ps1: line 403
at Invoke-PodeScriptBlock, C:\git\AwPwshDashboard\src\ps_modules\Pode\2.12.1\Public\Utilities.ps1: line 615
at Invoke-PodeEndware, C:\git\AwPwshDashboard\src\ps_modules\Pode\2.12.1\Private\Endware.ps1: line 19
at <ScriptBlock>, <No file>: line 156

Steps To Reproduce

Steps to reproduce the behavior:

  1. Not quite sure what causes it, but the error showed up once we added threads to Start-PodeServer

Expected Behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Platform

  • OS: Windows
  • Versions:
    • Pode: 2.12.1
    • PowerShell: 7.5.3

Additional Context

Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions