Title: PowerShell classes leak to other runspaces on macOS · Issue #9313 · PowerShell/PowerShell · GitHub
Open Graph Title: PowerShell classes leak to other runspaces on macOS · Issue #9313 · PowerShell/PowerShell
X Title: PowerShell classes leak to other runspaces on macOS · Issue #9313 · PowerShell/PowerShell
Description: Steps to reproduce class MyClass { # Property: Holds name [String] $Name # Constructor: Creates a new MyClass object, with the specified name MyClass([String] $NewName) { # Set name for MyClass $this.Name = $NewName } # Method: Method th...
Open Graph Description: Steps to reproduce class MyClass { # Property: Holds name [String] $Name # Constructor: Creates a new MyClass object, with the specified name MyClass([String] $NewName) { # Set name for MyClass $th...
X Description: Steps to reproduce class MyClass { # Property: Holds name [String] $Name # Constructor: Creates a new MyClass object, with the specified name MyClass([String] $NewName) { # Set name for MyClass $th...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/9313
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PowerShell classes leak to other runspaces on macOS","articleBody":"\u003c!--\r\n\r\nFor Windows PowerShell 5.1 issues, suggestions, or feature requests please use the following link instead:\r\nWindows PowerShell [UserVoice](https://windowsserver.uservoice.com/forums/301869-powershell)\r\n\r\nThis repository is **ONLY** for PowerShell Core 6 issues.\r\n\r\n- Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\r\n- Search the existing issues.\r\n- Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\r\n- Refer to the [known issues](https://docs.microsoft.com/powershell/scripting/whats-new/known-issues-ps6?view=powershell-6).\r\n\r\n-->\r\n\r\n# Steps to reproduce\r\n\r\n```powershell\r\nclass MyClass {\r\n # Property: Holds name\r\n [String] $Name\r\n\r\n # Constructor: Creates a new MyClass object, with the specified name\r\n MyClass([String] $NewName) {\r\n # Set name for MyClass\r\n $this.Name = $NewName\r\n }\r\n\r\n # Method: Method that changes $Name to the default name\r\n [void] ChangeNameToDefault() {\r\n $this.Name = \"DefaultName\"\r\n }\r\n }\r\n[MyClass].GetType()\r\n[PowerShell]::Create().AddScript('[MyClass]::new(\"ffff\")').Invoke()\r\n```\r\n\r\n# Expected behavior\r\n\r\nClass types should not leak to other runspaces.\r\n\r\n# Actual behavior\r\n\r\nType was able to be created in other runspace.\r\n\r\n\r\n# Environment data\r\n\r\n\u003c!-- provide the output of $PSVersionTable -->\r\n\r\n```none\r\nName Value\r\n---- -----\r\nPSVersion 6.2.0\r\nPSEdition Core\r\nGitCommitId 6.2.0\r\nOS Darwin 18.2.0 Darwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_64\r\nPlatform Unix\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n```\r\n\r\n# Notes\r\n\r\nThis doesn't repro without _using_ the class in some way (i.e. calling `[MyClass].GetType()`). That part is important.\r\n\r\ncc @daxian-dbw who wasn't able to repro this (I assume on Windows? Using PowerShell Core 6.2?)","author":{"url":"https://github.com/TylerLeonhardt","@type":"Person","name":"TylerLeonhardt"},"datePublished":"2019-04-07T01:10:32Z","url":"https://github.com/PowerShell/PowerShell/issues/9313"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:972803f3-1526-bc00-ec06-bd4691eda733 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 84E4:248A71:5BE13:826C8:6AFD48C7 |
| html-safe-nonce | 021ecffa443f22251d8d7a9896bc532489857dd5c4dc06b7ed361c3aaf9fb205 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NEU0OjI0OEE3MTo1QkUxMzo4MjZDODo2QUZENDhDNyIsInZpc2l0b3JfaWQiOiI1NDI2NDAyODcyMDIxMzA1NTQzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a06dd6bb60b1abd2ba9d52592bd37780840a2a8409291bde7b1363dded019f7d |
| hovercard-subject-tag | issue:430092777 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/9313/issue_layout |
| twitter:image | https://opengraph.githubassets.com/401f3e3e61abc0fb24303d7d929702bedd46a8e7ce3915afad9b9d16f0706412/PowerShell/PowerShell/issues/9313 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/401f3e3e61abc0fb24303d7d929702bedd46a8e7ce3915afad9b9d16f0706412/PowerShell/PowerShell/issues/9313 |
| og:image:alt | Steps to reproduce class MyClass { # Property: Holds name [String] $Name # Constructor: Creates a new MyClass object, with the specified name MyClass([String] $NewName) { # Set name for MyClass $th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | TylerLeonhardt |
| hostname | github.com |
| expected-hostname | github.com |
| None | bdbacc25b921224ff0befcb9e629560a1255be51aec9991d6e3f95b5e9151474 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 556dd37bb0aceffb25724e151b5d858b3265b40b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width