@@ -147,13 +147,13 @@ function PatchNupkgs {
147147
148148 $tfmFolderNetcoreapp21 = Get-ChildItem - Path " $libPath$delimeter *" | Where-Object {$_.Name -like " netcoreapp2.1" }
149149
150- if (([int ]($SDKVersion.Substring ( 0 , 1 ) ) -ge 5 ) -And ($null -ne $tfmFolderNet8 )){
150+ if (([int ]($SDKVersion.Split ( ' . ' , [ System.StringSplitOptions ]::RemoveEmptyEntries)[ 0 ] ) -ge 5 ) -And ($null -ne $tfmFolderNet8 )){
151151 $patchDll = Get-ChildItem - Path " $tfmFolderNet8$delimeter *" | Where-Object {$_.Name -like " *.dll" }
152152 }
153- elseif (([int ]($SDKVersion.Substring ( 0 , 1 ) ) -ge 5 ) -And ($null -ne $tfmFolderNet7 )){
153+ elseif (([int ]($SDKVersion.Split ( ' . ' , [ System.StringSplitOptions ]::RemoveEmptyEntries)[ 0 ] ) -ge 5 ) -And ($null -ne $tfmFolderNet7 )){
154154 $patchDll = Get-ChildItem - Path " $tfmFolderNet7$delimeter *" | Where-Object {$_.Name -like " *.dll" }
155155 }
156- elseif (([int ]($SDKVersion.Substring ( 0 , 1 ) ) -ge 5 ) -And (($tfmFolderNet5 -ne $null ) -Or ($tfmFolderNetcoreapp50 -ne $null ))){
156+ elseif (([int ]($SDKVersion.Split ( ' . ' , [ System.StringSplitOptions ]::RemoveEmptyEntries)[ 0 ] ) -ge 5 ) -And (($tfmFolderNet5 -ne $null ) -Or ($tfmFolderNetcoreapp50 -ne $null ))){
157157
158158 if ($tfmFolderNet5 -ne $null ){
159159 $patchDll = Get-ChildItem - Path " $tfmFolderNet5$delimeter *" | Where-Object {$_.Name -like " *.dll" }
@@ -353,7 +353,7 @@ function Patch
353353 " NuGet.CommandLine.XPlat" ,
354354 " NuGet.Credentials" )
355355
356- if (([int ]($SDKVersion.Substring ( 0 , 1 ) ) -le 7 ) )
356+ if (([int ]($SDKVersion.Split ( ' . ' , [ System.StringSplitOptions ]::RemoveEmptyEntries)[ 0 ] ) -le 7 ) )
357357 {
358358 Write-Host " Adding nuget.packaging.core"
359359 $copiedNupkgIds += " NuGet.Packaging.Core"
0 commit comments