Powershell: $PSVersionTable.GitCommitId returns 7.0.3 - is not sha1 commit id

Created on 17 Oct 2020  路  3Comments  路  Source: PowerShell/PowerShell

Steps to reproduce

$PSVersionTable.GitCommitId

Expected behavior

returns commit id (sha1 short or long)

Actual behavior

returns version of powershell 7.0.3 (tag)

Environment data

Name                           Value
----                           -----
PSVersion                      7.0.3
PSEdition                      Core
GitCommitId                    7.0.3
OS                             Microsoft Windows 10.0.16299
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0鈥
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Issue-Question Resolution-Answered

Most helpful comment

I believe this is expected for release versions, since it's the git tag for that commit. @SteveL-MSFT can probably correct me if I'm wrong 馃檪

All 3 comments

I believe this is expected for release versions, since it's the git tag for that commit. @SteveL-MSFT can probably correct me if I'm wrong 馃檪

@vexx32 is correct. See my comment in code:
https://github.com/PowerShell/PowerShell/blob/67bdf7292db700f5fecb9337d17b29457ae14ed2/src/System.Management.Automation/engine/PSVersionInfo.cs#L82-L93

(@vexx32 Be Merciful - Steve receives hundreds of notifications and fails to respond to all.)

@vexx32 if the couple "tag and commit" (e.g. v7.0.3 and 380e7db) remain unchanged forever, and patches are going only into the next version, then it might be ok.

Was this page helpful?
0 / 5 - 0 ratings