File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -590,16 +590,19 @@ function Add-AllModules {
590590 foreach ($package in $packages ) {
591591 $fileName = $package.Name
592592 $versionString = $fileName.Replace (' Az.Accounts.' , ' ' ).Replace(' .nupkg' , ' ' )
593- $version = [version ]$versionString
593+ if (-not ($versionString -match ' preview' ))
594+ {
595+ $version = [version ]$versionString
594596
595- if ($version -gt $latestVersion ) {
596- $latestVersion = $version
597- $latestPackage = $package
597+ if ($version -gt $latestVersion ) {
598+ $latestVersion = $version
599+ $latestPackage = $package
600+ }
598601 }
599602 }
600603
601604 foreach ($package in $packages ) {
602- if ($package.FullName -ne $latestPackage.FullName ) {
605+ if (( $package.FullName -ne $latestPackage.FullName ) -and -not ( $package .FullName -match ' preview ' ) ) {
603606 Remove-Item $package.FullName - Force
604607 }
605608 }
You can’t perform that action at this time.
0 commit comments