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

Add to Known Issues about using PowerShell Classes #497

Closed
Badgerati opened this issue Mar 5, 2020 · 1 comment · Fixed by #500
Closed

Add to Known Issues about using PowerShell Classes #497

Badgerati opened this issue Mar 5, 2020 · 1 comment · Fixed by #500
Assignees
Milestone

Comments

@Badgerati
Copy link
Owner

Describe the Change

Add to the Known Issues page the fact that PowerShell Classes do not work as expected, due to the way classes work, and Pode using runspaces.

Instances of classes are restricted to the runspace they were created, which can cause threading issues.

@fatherofinvention
Copy link
Contributor

Howdy @Badgerati - I'm wondering if the docs can be updated for this, and if you agree with my interpretation.

With the introduction of the [NoRunspaceAffinity] attribute in PowerShell 7.4, it seems maybe the workaround used in the CreateClassInstanceHelper.psm1 module isn't needed any longer since this new attribute allows classes to be declared in a way that they don't affiliate with a specific Runspace.

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_classes?view=powershell-7.4#example-4---class-definition-with-and-without-runspace-affinity

PowerShell/PowerShell#18138

MicrosoftDocs/PowerShell-Docs#9231

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants