GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [release/v7.6.7] Add GetImportModuleCommand method and session restriction check in ShowCommand by adityapatwardhan · Pull Request #28088 · PowerShell/PowerShell

Conversation

@adityapatwardhan

@adityapatwardhan Aditya Patwardhan (adityapatwardhan) commented Sep 24, 2026

Copy link
Copy Markdown
Member

Backport of #25557 to release/v7.6.7

Triggered by Aditya Patwardhan (@adityapatwardhan) on behalf of Travis Plunk (@TravisEz13)

Original CL Label: CL-General

/cc @PowerShell/powershell-maintainers

Impact

REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.

Tooling Impact

  • Required tooling change
  • Optional tooling change (include reasoning)

Customer Impact

  • Customer reported
  • Found internally

Fixes #25556, where Show-Command lacks the module import helper behavior and can run in unsupported restricted remoting sessions instead of returning a clear terminating error.

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

The Show-Command behavior regression was introduced by #20593.

Testing

The backport cherry-picked cleanly and is exactly one commit ahead of upstream/release/v7.6.7. The resulting three-file, 41-line diff was reviewed against the original PR diff, and git diff --check passed. Supported CI validation is required before merge.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

Medium risk because this changes Show-Command behavior and module-import script generation, but the changes are limited to the graphical host helper and an explicit restricted-session guard. The backport cherry-picked cleanly without manual conflict resolution.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@TravisEz13 @adityapatwardhan
Add GetImportModuleCommand method back and check for session restri…
af5f353
…ction in `ShowCommand` (PowerShell#25557)
@adityapatwardhan Aditya Patwardhan (adityapatwardhan) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Sep 24, 2026
Copilot AI lite review requested due to automatic review settings September 24, 2026 05:48
@adityapatwardhan Aditya Patwardhan (adityapatwardhan) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Sep 24, 2026
@azure-pipelines

azure-pipelines Bot commented Sep 24, 2026

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot started reviewing on behalf of Aditya Patwardhan (adityapatwardhan) September 24, 2026 05:49
View session
Copilot AI reviewed Sep 24, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The generated retry script has a parsing issue, and the isFirstChance documentation needs correction.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)
  • Low severity Correct reversed isFirstChance documentation · New
What changed in this PR

Backports Show-Command fixes for module imports and restricted remoting sessions.

Changes:

  • Restores module-import command generation.
  • Rejects unsupported restricted sessions.
  • Adds the corresponding error resource.
File Summary Review notes
src/​System.Management.Automation/​resources/​HelpErrors.resx Adds the restricted-session error message. No issues noted.
src/​Microsoft.PowerShell.Commands.Utility/​commands/​utility/​ShowCommand/​ShowCommand.cs Adds restricted-session validation. No issues noted.
src/​Microsoft.Management.UI.Internal/​commandHelpers/​ShowCommandHelper.cs Generates module-import and command-refresh scripts. Moderate issue: add a statement separator before the serialized script. Nit: correct the isFirstChance documentation.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/Microsoft.Management.UI.Internal/commandHelpers/ShowCommandHelper.cs
/// </summary>
/// <param name="module">Module we want to import.</param>
/// <param name="isRemoteRunspace">Boolean flag determining whether Show-Command is queried in the local or remote runspace scenario.</param>
/// <param name="isFirstChance">Boolean flag to indicate that it is the second attempt to query Show-Command data.</param>
jshigetomi
Justin Chung (jshigetomi) approved these changes Sep 24, 2026
View reviewed changes
@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) merged commit 6cb2755 into PowerShell:release/v7.6.7 Sep 24, 2026
37 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) deleted the backport/release/v7.6.7/25557-eef085210 branch September 24, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@jshigetomi Justin Chung (jshigetomi) jshigetomi approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@adityapatwardhan @jshigetomi @TravisEz13
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.