From b973bb93e43ec91077e6c78a70d8f545c9006a96 Mon Sep 17 00:00:00 2001 From: Hiroshi Inoue Date: Thu, 5 Oct 2017 22:02:01 +0900 Subject: [PATCH] Correct the use of MatchInfo object which is an output of Select-String. --- installer/buildInstallers.ps1 | 2 +- winbuild/MSProgram-Get.psm1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/buildInstallers.ps1 b/installer/buildInstallers.ps1 index 8b25b87..53bdb37 100644 --- a/installer/buildInstallers.ps1 +++ b/installer/buildInstallers.ps1 @@ -181,7 +181,7 @@ function buildInstaller([string]$CPUTYPE) $PODBCMSVPSYS=$PODBCMSVCSYS.Replace((msvcrun $runtime_version0), $str_msvcp) } # where's the runtime dll libpq links? - $msvclist=& ${dumpbinexe} /imports $LIBPQBINDIR\libpq.dll | select-string -pattern "^\s*($msrun_ptn)(\d+)0\.dll" | % {$_.matches[0].Groups[2].Value} + $msvclist=& ${dumpbinexe} /imports $LIBPQBINDIR\libpq.dll | select-string -pattern "^\s*($msrun_ptn)(\d+)0\.dll" | % {$_.Matches.Groups[2].Value} if ($msvclist -ne $Null -and $msvclist.length -gt 0) { if ($msvclist.GetType().Name -eq "String") { $runtime_version1=[int]$msvclist diff --git a/winbuild/MSProgram-Get.psm1 b/winbuild/MSProgram-Get.psm1 index 4805aac..c955b7c 100644 --- a/winbuild/MSProgram-Get.psm1 +++ b/winbuild/MSProgram-Get.psm1 @@ -254,7 +254,7 @@ function Find-Dumpbin([int]$CurMaxVC = 15) function dumpbinRecurs([string]$dllname, [string]$dllfolder, [array]$instarray) { - $tmem=& ${dumpbinexe} /imports "$dllfolder\${dllname}" | select-string -pattern "^\s*(\S*\.dll)" | % {$_.matches[0].Groups[1].Value} | where-object {test-path ("${dllfolder}\" + $_)} + $tmem=& ${dumpbinexe} /imports "$dllfolder\${dllname}" | select-string -pattern "^\s*(\S*\.dll)" | % {$_.Matches.Groups[1].Value} | where-object {test-path ("${dllfolder}\" + $_)} if ($LASTEXITCODE -ne 0) { throw "Failed to dumpbin ${dllfolder}\${dllname}" } -- 2.39.5