From 47b875b5ee8f251634a5c7bf2c912fa57d95dbcd Mon Sep 17 00:00:00 2001 From: Justin Grote Date: Fri, 26 Jan 2024 19:34:57 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Some=20classic=20paths=20not=20a?= =?UTF-8?q?ble=20to=20be=20processed=20correctly=20Fixes=20#69?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ModuleFast.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ModuleFast.psm1 b/ModuleFast.psm1 index caf27f6..7ab455e 100644 --- a/ModuleFast.psm1 +++ b/ModuleFast.psm1 @@ -1776,7 +1776,7 @@ function Find-LocalModule { $manifestPath = Join-Path $moduleFolder $manifestName if (Test-Path $ModuleFolder) { - $candidatePaths.Add([Tuple]::Create($moduleVersion, $manifestPath)) + $candidatePaths.Add([Tuple]::Create([version]$moduleVersion, $manifestPath)) } } else { #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 { } } - $candidatePaths.Add([Tuple]::Create($version, $PSItem)) + $candidatePaths.Add([Tuple]::Create([Version]$version, $PSItem)) } } @@ -1820,7 +1820,7 @@ function Find-LocalModule { #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. [version]$classicVersion = (Import-ModuleManifest $classicManifestPath).ModuleVersion Write-Debug "${ModuleSpec}: Found classic module $classicVersion at $moduleBaseDir" - $candidatePaths.Add([Tuple]::Create($classicVersion, $moduleBaseDir)) + $candidatePaths.Add([Tuple[Version, String]]::new($classicVersion, $moduleBaseDir)) } }