Skip to content

Make PowerShell 5.1 usage more prominent #7140

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

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

Conversation

martincostello
Copy link
Member

Make requirement to use Windows PowerShell to install zero-code instrumentation for .NET on Windows more prominent.

Also add directive to the script to fail if the wrong version of PowerShell is used.

See open-telemetry/opentelemetry-dotnet-instrumentation#2018.

@Copilot Copilot AI review requested due to automatic review settings June 18, 2025 09:19
@martincostello martincostello requested a review from a team as a code owner June 18, 2025 09:19
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR makes the usage of Windows PowerShell for installing zero-code instrumentation on .NET more explicit by emphasizing that only the built-in PowerShell 5.1 is supported.

  • Added a highlighted alert to warn users against using PowerShell 6.0+ (pwsh).
  • Updated the inline comment and introduced the "#Requires -PSEdition Desktop" directive to fail early when an incorrect version is used.
Comments suppressed due to low confidence (2)

content/en/docs/zero-code/dotnet/_index.md:88

  • Consider rephrasing the alert message to improve clarity, e.g., 'PowerShell v6.0+ (pwsh) is not supported. Only the built-in Windows PowerShell 5.1 is supported for installing .NET zero-code instrumentation.'
PowerShell v6.0+ (pwsh) is not supported in install .NET zero-code instrumentation - the built-in version of Windows PowerShell must be used.

content/en/docs/zero-code/dotnet/_index.md:94

  • Ensure the inline comment aligns with the alert message for consistency, clearly indicating that only Windows PowerShell 5.1 (the built-in edition) should be used.
# PowerShell 5.1 is required

@svrnm svrnm requested a review from a team June 18, 2025 09:53
@svrnm
Copy link
Member

svrnm commented Jun 18, 2025

thanks @martincostello

@open-telemetry/dotnet-instrumentation-approvers please take a look and review/approve

@martincostello
Copy link
Member Author

I can't for the life of me work out what the lint warning is about.

The CI logs don't say, and if I run it locally on my Windows laptop, then no edits are made when I use --write.

@svrnm
Copy link
Member

svrnm commented Jun 18, 2025

I can't for the life of me work out what the lint warning is about.

The CI logs don't say, and if I run it locally on my Windows laptop, then no edits are made when I use --write.

I see that... it's odd, don't worry about that, that's a maintainer issue.

@chalin
Copy link
Contributor

chalin commented Jun 18, 2025

/fix:format

@opentelemetrybot
Copy link
Collaborator

fix:format applied successfully in this run.

martincostello and others added 5 commits June 18, 2025 06:32
Make requirement to use Windows PowerShell to install zero-code instrumentation for .NET on Windows more prominent.

See open-telemetry/opentelemetry-dotnet-instrumentation#2018.
Add pwsh to the spellings to ignore.
Fix lint warning (I assume) from line being too long.
@@ -5,7 +5,7 @@ linkTitle: .NET
aliases: [net]
redirects: [{ from: /docs/languages/net/automatic/*, to: ':splat' }]
weight: 30
cSpell:ignore: coreutils HKLM iisreset myapp
cSpell:ignore: coreutils HKLM iisreset myapp pwsh
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
cSpell:ignore: coreutils HKLM iisreset myapp pwsh
cSpell:ignore: coreutils HKLM iisreset myapp

Comment on lines +87 to 91
{{% alert title="Note" color="warning" %}} PowerShell v6.0+ (pwsh) is not
supported to install .NET zero-code instrumentation. The built-in version of
Windows PowerShell must be used. {{% /alert %}}

On Windows, use the PowerShell module as an Administrator:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{{% alert title="Note" color="warning" %}} PowerShell v6.0+ (pwsh) is not
supported to install .NET zero-code instrumentation. The built-in version of
Windows PowerShell must be used. {{% /alert %}}
On Windows, use the PowerShell module as an Administrator:
On Windows, use the PowerShell module as an Administrator.
{{% alert title="Version note" color="warning" %}}
PowerShell v5.1 is required. In particular, v6.0+ is not yet supported.
{{% /alert %}}

Copy link
Member Author

Choose a reason for hiding this comment

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

There's some nuance here I think your suggested edit misses.

Windows PowerShell is basically v5 forever, there isn't a v6.

PowerShell (Core) (pwsh) started with v6 and is currently at v7.5.

The former is the Desktop edition, the latter is the Core edition.

That's why my original copy explicitly distinguishes between the two by saying Windows PowerShell and clarifying v6 is pwsh.

On Windows, use the PowerShell module as an Administrator:

```powershell
# PowerShell 5.1 or higher is required
# PowerShell 5.1 is required
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# PowerShell 5.1 is required
#Requires -Version 5.1

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure this is needed or not. All I know is it definitely doesn't work on the Core edition. I just removed "or higher" because there is no higher version of the Desktop edition and I'm not sure there ever will be.

@chalin
Copy link
Contributor

chalin commented Jun 18, 2025

@open-telemetry/dotnet-approvers @open-telemetry/dotnet-instrumentation-approvers - can someone validate the version requirements? Thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants