Skip to content

Show-Command crashes when clicking "Show Details" on a command #25556

Description

Prerequisites

Steps to reproduce

Repro steps

  1. Run Show-Command in PowerShell 7.4
  2. Click a command
  3. Click "Show Details" (show in the screenshot below)

Image

Reason

The GetImportModuleCommand method was removed in the PR #20593 (see https://github.com/PowerShell/PowerShell/pull/20593/files#diff-6049789826a31f0b0d8365b339ae7b8fdd8c977fec824cb44397f744adeba639L499).
However, the Show-Command depends on this method to work for the "Show Details" button.

Expected behavior

No crash, no freezing. The details of the command will be shown.

Actual behavior

The GUI freezes and a NullReferenceException is thrown from `Show-Command` in PowerShell.

Error details

PS:10> Show-Command
Show-Command: Object reference not set to an instance of an object.

Environment data

PS:11> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.4.7
PSEdition                      Core
GitCommitId                    7.4.7
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Activity

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

Metadata

Metadata

Labels

7.4-regressionRegression in 7.4Issue-BugIssue has been identified as a bug in the productWG-Cmdletsgeneral cmdlet issuesWG-NeedsReviewNeeds a review by the labeled Working Group

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions