Skip to content

Commit ac4eac9

Browse files
authored
🐛 Some classic paths not able to be processed correctly (#72)
Some classic paths were not casting to the correct versions, such as PowerShellGet, during a -Update check. Those should be working correctly now. Fixes #69
1 parent 868a205 commit ac4eac9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ModuleFast.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,7 +1776,7 @@ function Find-LocalModule {
17761776
$manifestPath = Join-Path $moduleFolder $manifestName
17771777

17781778
if (Test-Path $ModuleFolder) {
1779-
$candidatePaths.Add([Tuple]::Create($moduleVersion, $manifestPath))
1779+
$candidatePaths.Add([Tuple]::Create([version]$moduleVersion, $manifestPath))
17801780
}
17811781
} else {
17821782
#Check for versioned module folders next and sort by the folder versions to process them in descending order.
@@ -1807,7 +1807,7 @@ function Find-LocalModule {
18071807
}
18081808
}
18091809

1810-
$candidatePaths.Add([Tuple]::Create($version, $PSItem))
1810+
$candidatePaths.Add([Tuple]::Create([Version]$version, $PSItem))
18111811
}
18121812
}
18131813

@@ -1820,7 +1820,7 @@ function Find-LocalModule {
18201820
#NOTE: This does result in Import-PowerShellData getting called twice which isn't ideal for performance, but classic modules should be fairly rare and not worth optimizing.
18211821
[version]$classicVersion = (Import-ModuleManifest $classicManifestPath).ModuleVersion
18221822
Write-Debug "${ModuleSpec}: Found classic module $classicVersion at $moduleBaseDir"
1823-
$candidatePaths.Add([Tuple]::Create($classicVersion, $moduleBaseDir))
1823+
$candidatePaths.Add([Tuple[Version, String]]::new($classicVersion, $moduleBaseDir))
18241824
}
18251825
}
18261826

0 commit comments

Comments
 (0)