Skip to content

Commit 1bd2c3f

Browse files
Justin GroteJustin Grote
authored andcommitted
Skip missing PSModulePath folders
1 parent 9103ede commit 1bd2c3f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

ModuleFast.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,8 @@ function Find-LocalModule {
11301130

11311131
# NOTE: We are intentionally using return instead of continue here, as soon as we find a match we are done.
11321132
foreach ($modulePath in $modulePaths) {
1133+
if (-not [Directory]::Exists($modulePath)) { continue }
1134+
11331135
#Linux/Mac support requires a case insensitive search on a user supplied variable.
11341136
$moduleDir = [Directory]::GetDirectories($modulePath, $moduleSpec.Name, [EnumerationOptions]@{MatchCasing = 'CaseInsensitive' })
11351137
if ($moduleDir.count -gt 1) { throw "$($moduleSpec.Name) folder is ambiguous, please delete one of these folders: $moduleDir" }

0 commit comments

Comments
 (0)