Title: PSSessions with Containers throw NullReferenceException · Issue #13347 · PowerShell/PowerShell · GitHub
Open Graph Title: PSSessions with Containers throw NullReferenceException · Issue #13347 · PowerShell/PowerShell
X Title: PSSessions with Containers throw NullReferenceException · Issue #13347 · PowerShell/PowerShell
Description: Cmdlets that deal with PSSessions created on ContainerId throw a NullReferenceException when creating the session. This is true for New-PSSession, Enter-PSSession and Invoke-Command, among maybe others. The stack trace is this: Object re...
Open Graph Description: Cmdlets that deal with PSSessions created on ContainerId throw a NullReferenceException when creating the session. This is true for New-PSSession, Enter-PSSession and Invoke-Command, among maybe ot...
X Description: Cmdlets that deal with PSSessions created on ContainerId throw a NullReferenceException when creating the session. This is true for New-PSSession, Enter-PSSession and Invoke-Command, among maybe ot...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/13347
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PSSessions with Containers throw NullReferenceException","articleBody":"Cmdlets that deal with PSSessions created on ContainerId throw a NullReferenceException when creating the session. This is true for `New-PSSession`, `Enter-PSSession` and `Invoke-Command`, among maybe others.\r\n\r\nThe stack trace is this:\r\n````\r\nObject reference not set to an instance of an object.\r\n at System.Management.Automation.Runspaces.ContainerProcess.GetContainerProperties()\r\n at Microsoft.PowerShell.Commands.PSExecutionCmdlet.CreateHelpersForSpecifiedContainerSession()\r\n````\r\n\r\nFor me the line that fails is inside `GetContainerPropertiesInternal` of the class `System.Management.Automation.Runspaces.ContainerProcess` in `System.Management.Automation.dll`.\r\n\r\n`ContainerObRoot = (string) computeSystemPropertiesType.GetProperty(\"ObRoot\").GetValue(obj);`\r\n\r\n## Steps to reproduce\r\n\r\nTo reproduce this a running container is required.\r\n\r\n```powershell\r\nNew-PSSession -ContainerId \u003cTheContainerId> -RunAsAdministrator\r\n```\r\n\r\n## Expected behavior\r\n\r\nAn instance of `PSSession` should be created.\r\n\r\n## Actual behavior\r\n\r\nA NullReferenceException is thrown.\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 7.0.3\r\nPSEdition Core\r\nGitCommitId 7.0.3\r\nOS Microsoft Windows 10.0.18363\r\nPlatform Win32NT\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```","author":{"url":"https://github.com/hemisphera","@type":"Person","name":"hemisphera"},"datePublished":"2020-08-04T09:01:17Z","url":"https://github.com/PowerShell/PowerShell/issues/13347"}
| 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:a792a8d5-4de8-8b8e-6774-3118139a9410 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8F3A:1B2160:D29AD7:12E18A6:6AFDA099 |
| html-safe-nonce | 5a5feb56d1ecb3b7e617078fb85a3c46fbaadf6286129caf0abdae10c922c71b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjNBOjFCMjE2MDpEMjlBRDc6MTJFMThBNjo2QUZEQTA5OSIsInZpc2l0b3JfaWQiOiI3NTI2ODk3MTk4MzkxMjA2MDQxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 99a6c1c85e71e1e77e78571eb0171aa272b891332864a1775c101b27f61a37db |
| hovercard-subject-tag | issue:672629646 |
| 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/13347/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4282c0127a23863d273272c59681219c3e763d5a5cb491f143f25e50a83065c9/PowerShell/PowerShell/issues/13347 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4282c0127a23863d273272c59681219c3e763d5a5cb491f143f25e50a83065c9/PowerShell/PowerShell/issues/13347 |
| og:image:alt | Cmdlets that deal with PSSessions created on ContainerId throw a NullReferenceException when creating the session. This is true for New-PSSession, Enter-PSSession and Invoke-Command, among maybe ot... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hemisphera |
| hostname | github.com |
| expected-hostname | github.com |
| None | bc86424ef34a73b386237872800e922d149d65ba907f63d6f150a2dcb8433bea |
| 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 | 927a6c5ab1c32b38830f1b9d3050c0b9e9aa92e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width