Skip to content

Commit f017167

Browse files
StartAutomatingStartAutomating
authored andcommitted
Include - Adding -Exclude (Fixes #418)
1 parent b948eca commit f017167

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

PipeScript.psm1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
foreach ($file in (Get-ChildItem -Path "$psScriptRoot" -Filter "*-*" -Recurse)) {
1+
:ToIncludeFiles foreach ($file in (Get-ChildItem -Path "$psScriptRoot" -Filter "*-*" -Recurse)) {
22
if ($file.Extension -ne '.ps1') { continue } # Skip if the extension is not .ps1
3-
if ($file.Name -match '\.[^\.]+\.ps1$') { continue } # Skip if the file is an unrelated file.
3+
foreach ($exclusion in '\.[^\.]+\.ps1$') {
4+
if (-not $exclusion) { continue }
5+
if ($file.Name -match $exclusion) {
6+
continue ToIncludeFiles # Skip excluded files
7+
}
8+
}
49
. $file.FullName
510
}
611

0 commit comments

Comments
 (0)