From 0bcc2a2a8fa9c511cef2b0f0f0010f616916c8bc Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 8 Dec 2017 11:37:29 -0800 Subject: [PATCH] Get GitCommitId using the ProductVersion from Assembly (#5651) --- .../tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 b/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 index 086b92ac11..bd3fd21eae 100644 --- a/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 +++ b/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 @@ -241,8 +241,11 @@ try } # grab the commitID, we need this to grab the right sources - $gitCommitId = & "$psBinPath\pwsh.exe" -noprofile -command { $PSVersiontable.GitCommitId } - $commitId = $gitCommitId.substring($gitCommitId.LastIndexOf('-g') + 2) + $assemblyLocation = & "$psBinPath\pwsh.exe" -noprofile -command { Get-Item ([psobject].Assembly.Location) } + $productVersion = $assemblyLocation.VersionInfo.productVersion + $commitId = $productVersion.split(" ")[-1] + + Write-LogPassThru -Message "Using GitCommitId: $commitId" # download the src directory try