Correct the use of MatchInfo object which is an output of Select-String.
authorHiroshi Inoue <h-inoue@dream.email.ne.jp>
Thu, 5 Oct 2017 13:02:01 +0000 (22:02 +0900)
committerHiroshi Inoue <h-inoue@dream.email.ne.jp>
Thu, 5 Oct 2017 13:02:01 +0000 (22:02 +0900)
installer/buildInstallers.ps1
winbuild/MSProgram-Get.psm1

index 8b25b872893bbafd9d0e95782260067945b79acd..53bdb37b29b63666fcb583333e792ffe7c794872 100644 (file)
@@ -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
index 4805aac157d7c0439dcac1b22d5e65afe369e419..c955b7c50eb6499600d772353d1475a5369bad40 100644 (file)
@@ -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}"
    }