Title: Enter-PsSession: NullReferenceException crash in 7.4.1 · Issue #21253 · PowerShell/PowerShell · GitHub
Open Graph Title: Enter-PsSession: NullReferenceException crash in 7.4.1 · Issue #21253 · PowerShell/PowerShell
X Title: Enter-PsSession: NullReferenceException crash in 7.4.1 · Issue #21253 · PowerShell/PowerShell
Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerShell 5.1 and PowerShell. Steps to reprodu...
Open Graph Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
X Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/21253
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Enter-PsSession: NullReferenceException crash in 7.4.1","articleBody":"### Prerequisites\n\n- [X] Write a descriptive title.\n- [X] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\n- [X] Search the existing issues.\n- [X] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\n- [X] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\n\n### Steps to reproduce\n\n1. Open a powershell\r\n2. Use Get-Credential to capture a credential that has permissions to remote into a different machine\r\n3. Type: Enter-PsSession [remote machine] -Credentials [credentials]\r\n\r\n**Note**\r\nThis only seems to occur during an interactive session. If I use Invoke-Command passing a computer name, or session variable, it executes without issue. e.g. The following works:\r\n\r\n$creds = Get-Credential\r\n$script = { Get-ChildItem }\r\nInvoke-Command [Computer] -ScriptBlock $script -Credential $creds\n\n### Expected behavior\n\n```console\nAn interactive remote session is started\n```\n\n\n### Actual behavior\n\n```console\nThe terminal displays a NullReferenceException then crashes\n```\n\n\n### Error details\n\n```console\nApplication: pwsh.exe\r\nCoreCLR Version: 8.0.123.58001\r\n.NET Version: 8.0.1\r\nDescription: The application requested process termination through System.Environment.FailFast.\r\nMessage: Object reference not set to an instance of an object.\r\nDescription: The process was terminated due to an unhandled exception.System.NullReferenceException: Object reference not set to an instance of an object.\r\n at System.Management.Automation.Security.SystemPolicy.LogWDACAuditMessage(ExecutionContext context, String title, String message, String fqid, Boolean dropIntoDebugger)\r\n at System.Management.Automation.Remoting.RunspaceRef.ParsePsCommandUsingScriptBlock(String line, Nullable`1 useLocalScope)\r\n at System.Management.Automation.Remoting.RunspaceRef.CreatePipeline(String line, Boolean addToHistory, Boolean useNestedPipelines)\r\n at Microsoft.PowerShell.Executor.ExecuteCommandAndGetResultAsString(String command, Exception\u0026 exceptionThrown)\r\n at Microsoft.PowerShell.ConsoleHost.InputLoop.EvaluatePrompt()\r\n at Microsoft.PowerShell.ConsoleHost.InputLoop.Run(Boolean inputLoopIsNested)\r\n at Microsoft.PowerShell.ConsoleHost.InputLoop.RunNewInputLoop(ConsoleHost parent, Boolean isNested)\r\n at Microsoft.PowerShell.ConsoleHost.EnterNestedPrompt()\r\n at Microsoft.PowerShell.ConsoleHost.DoRunspaceLoop(String initialCommand, Boolean skipProfiles, Collection`1 initialCommandArgs, Boolean staMode, String configurationName, String configurationFilePath)\r\n at Microsoft.PowerShell.ConsoleHost.Run(CommandLineParameterParser cpp, Boolean isPrestartWarned)\r\n at Microsoft.PowerShell.ConsoleHost.Start(String bannerText, String helpText, Boolean issProvidedExternally)\r\n at Microsoft.PowerShell.UnmanagedPSEntry.Start(String[] args, Int32 argc)\r\nStack:\r\n at System.Environment.FailFast(System.String, System.Exception)\r\n at Microsoft.PowerShell.UnmanagedPSEntry.Start(System.String[], Int32)\r\n at Microsoft.PowerShell.ManagedPSEntry.Main(System.String[])\n```\n\n\n### Environment data\n\n```powershell\nName Value\r\n\r\n---- -----\r\n\r\nPSVersion 7.4.1\r\n\r\nPSEdition Core\r\n\r\nGitCommitId 7.4.1\r\n\r\nOS Microsoft Windows 10.0.19045\r\n\r\nPlatform Win32NT\r\n\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\n\r\nPSRemotingProtocolVersion 2.3\r\n\r\nSerializationVersion 1.1.0.1\r\n\r\nWSManStackVersion 3.0\n```\n\n\n### Visuals\n\n_No response_","author":{"url":"https://github.com/scalessm","@type":"Person","name":"scalessm"},"datePublished":"2024-02-20T22:41:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/21253/PowerShell/issues/21253"}
| 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:fd92f551-87ab-5852-57a9-02cc7cf20ace |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E182:2AE5C2:26F6E15:3867EF8:6A55096B |
| html-safe-nonce | 19cd180ae7bd3d6747cd81a28db0af50cca914067c8e45f73043490335fb3c00 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTgyOjJBRTVDMjoyNkY2RTE1OjM4NjdFRjg6NkE1NTA5NkIiLCJ2aXNpdG9yX2lkIjoiNTA5MDE0NzAxNzY2MzI1Mjg0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 38f1a355a8908a0a28f15ee022c01e7fae4017444a689c279f8436bcbd6b495e |
| hovercard-subject-tag | issue:2145415481 |
| 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/21253/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c54fb45ec49b295568bd1633854560c34bb7bb876e83271a832826190425ec6f/PowerShell/PowerShell/issues/21253 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c54fb45ec49b295568bd1633854560c34bb7bb876e83271a832826190425ec6f/PowerShell/PowerShell/issues/21253 |
| og:image:alt | Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | scalessm |
| hostname | github.com |
| expected-hostname | github.com |
| None | eae2aab99907699a22d2c8449aa683ca74454fca87211b98f7c7b722086b2839 |
| 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 | 6a35ab858be185cd86d12b93a43bccf34e8d8536 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width