Skip to content

Commit da8c72d

Browse files
committed
✨ ModuleFast will now search directories for manifests if given one via -Path
1 parent 7b578b0 commit da8c72d

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

ModuleFast.psm1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,16 @@ function Install-ModuleFast {
346346
break
347347
}
348348
'Path' {
349-
$ModulesToInstall = ConvertFrom-RequiredSpec -RequiredSpecPath $Path -SpecFileType $SpecFileType
349+
$Paths = @()
350+
#Search for a spec file if a directory was provided
351+
if ('Directory' -in (Get-Item $Path).Attributes) {
352+
$Paths += Find-RequiredSpecFile -Path $Path
353+
} else {
354+
$Paths = $Path
355+
}
356+
foreach ($pathItem in $Paths) {
357+
$ModulesToInstall = ConvertFrom-RequiredSpec -RequiredSpecPath $pathItem -SpecFileType $SpecFileType
358+
}
350359
}
351360
}
352361
}

Test/Mocks/ModuleFast.requires.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"PnP.PowerShell": "2.2.156-nightly",
2+
"PnP.PowerShell": "2.10.4-nightly",
33
"Pester": "=5.4.0",
44
"Az.Accounts": ":[2.0.0, 2.13.2)",
55
"ImportExcel": "latest",

Test/Mocks/ModuleFast.requires.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@{
22
'ImportExcel' = 'latest'
3-
'PnP.PowerShell' = '2.2.156-nightly'
3+
'PnP.PowerShell' = '2.10.4-nightly'
44
'PSScriptAnalyzer' = '<=1.21.0'
55
'Pester' = '=5.4.0'
66
'Az.Accounts' = ':[2.0.0, 2.13.2)'

Test/Mocks/ModuleFastArray.requires.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[
22
"ImportExcel",
3-
"PnP.PowerShell=2.2.156-nightly",
3+
"PnP.PowerShell=2.10.4-nightly",
44
"PSScriptAnalyzer<=1.21.0",
55
"Pester=5.4.0",
66
"Az.Accounts:[2.0.0, 2.13.2)"

0 commit comments

Comments
 (0)