Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes PowerShell Usage Explicit #113

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jonathansampson
Copy link
Contributor

Motivation and Context

It may not be clear to some readers that many of the commands intended for Windows are also intended for a PowerShell context, rather than a more traditional cmd.exe context. As such, it would be good to explicitly inform the user that PowerShell is the intended execution environment.

How Has This Been Tested?

Yes

Breaking Changes

No

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

It may not be clear to some readers that many of the commands intended for Windows are also intended for a PowerShell context, rather than a more traditional cmd.exe context. As such, it would be good to explicitly inform the user that PowerShell is the intended execution environment.
Copy link
Member

@jspahrsummers jspahrsummers left a comment

Choose a reason for hiding this comment

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

Thanks for the suggestion! I agree with the premise, but I wonder if there's some other way we can indicate it rather than qualifying "Windows" everywhere we mention the platform.

A couple of spitball ideas:

  1. Could we check for the presence of PowerShell programmatically? e.g., look for $PSVersionTable?
  2. Could we note that it's PowerShell in an inline comment?
  3. Or, maybe we just add a natural language blurb to each of these excerpts (e.g., in a preceding paragraph) that explains

What do you think?

@jonathansampson
Copy link
Contributor Author

@jspahrsummers Can you elaborate on your first suggestion (i.e., checking for the presence of powershell)? My proposal is simply to make the instances of PowerShell code in the documentation more explicitly identified as such, so as to avoid confusion where the reader attempts to execute a PowerShell command in a cmd.exe environment. I also considered inline comments; I'll submit a commit with that route instead.

@jspahrsummers
Copy link
Member

jspahrsummers commented Jan 22, 2025

Can you elaborate on your first suggestion (i.e., checking for the presence of powershell)?

The idea (only half-thought-through) was to place some executable marker into the snippets that would identify if the user is running the excerpt in cmd, and suggest the use of PowerShell instead.

This might be overkill, or too verbose, or unworkable for other reasons—so TIOLI 🙂 I'm also totally happy just annotating each of these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants