PowerShell / PowerShell/PowerShell

ProductVersion of pwsh.exe lists Git commit ID twice

Open
#27,190 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs-Triage Review - Maintainer
Dominant language
C#
Stars
55.5k
Forks
8.5k
Avg merge
1d 2h
Merged PRs (30d)
88

Description

Prerequisites
Steps to reproduce

The ProductVersion string in the version resource of almost every PowerShell PE file lists the same Git commit ID twice, separated with a plus sign. Just once would be enough.

(However, that does not apply to Microsoft.PowerShell.MarkdownRender.dll, where the ProductVersion is just 7.2.1.)

Expected behavior
PS> (Get-Item "${PSHOME}/pwsh.exe").VersionInfo.ProductVersion
7.6.0 SHA: 6effea0e216b190f989e227f5a20b670804a07fb
PS> (Get-Item "${PSHOME}/pwsh.dll").VersionInfo.ProductVersion
7.6.0 SHA: 6effea0e216b190f989e227f5a20b670804a07fb
PS> (Get-Item "${PSHOME}/System.Management.Automation.dll").VersionInfo.ProductVersion
7.6.0 SHA: 6effea0e216b190f989e227f5a20b670804a07fb
PS> Get-Item "${PSHOME}/*.dll","${PSHOME}/*.exe" | Where-Object { $_.VersionInfo.ProductName -like '*PowerShell*' } | Group-Object { $_.VersionInfo.ProductName},{ $_.VersionInfo.ProductVersion } | Select-Object Count,Name

Count Name
----- ----
   14 PowerShell, 7.6.0 SHA: 6effea0e216b190f989e227f5a20b670804a07fb
    1 PowerShell Markdown Renderer, 7.2.1
Actual behavior
PS> (Get-Item "${PSHOME}/pwsh.exe").VersionInfo.ProductVersion
7.6.0 SHA: 6effea0e216b190f989e227f5a20b670804a07fb+6effea0e216b190f989e227f5a20b670804a07fb
PS> (Get-Item "${PSHOME}/pwsh.dll").VersionInfo.ProductVersion
7.6.0 SHA: 6effea0e216b190f989e227f5a20b670804a07fb+6effea0e216b190f989e227f5a20b670804a07fb
PS> (Get-Item "${PSHOME}/System.Management.Automation.dll").VersionInfo.ProductVersion
7.6.0 SHA: 6effea0e216b190f989e227f5a20b670804a07fb+6effea0e216b190f989e227f5a20b670804a07fb
PS> Get-Item "${PSHOME}/*.dll","${PSHOME}/*.exe" | Where-Object { $_.VersionInfo.ProductName -like '*PowerShell*' } | Group-Object { $_.VersionInfo.ProductName},{ $_.VersionInfo.ProductVersion } | Select-Object Count,Name

Count Name
----- ----
   14 PowerShell, 7.6.0 SHA: 6effea0e216b190f989e227f5a20b670804a07fb+6effea0e216b190f989e227f5a20b670804a07fb
    1 PowerShell Markdown Renderer, 7.2.1
Error details

Environment data
Name                           Value
----                           -----
PSVersion                      7.6.0
PSEdition                      Core
GitCommitId                    7.6.0
OS                             Microsoft Windows 10.0.26200
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.4
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Visuals

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names pwsh.exe, pwsh.dll, and System.Management.Automation.dll but no source file or test; start by tracing the build or version-resource entry point that produces their ProductVersion values. Reproduce with the shown Get-Item commands and consider the work done when PowerShell binaries report the commit ID once while Microsoft.PowerShell.MarkdownRender.dll remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.