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