Skip to content

Commit f9d8529

Browse files
StartAutomatingStartAutomating
StartAutomating
authored and
StartAutomating
committed
Merge pull request #101 from StartAutomating/PipeScriptFixesAndFun
Pipe script fixes
1 parent d91750a commit f9d8529

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

PipeScript.psm1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
foreach ($file in (Get-ChildItem -Path "$psScriptRoot" -Filter "*-*" -Recurse)) {
2-
if ($file.Extension -ne '.ps1') { continue }
2+
if ($file.Extension -ne '.ps1') { continue } # Skip if the extension is not .ps1
3+
if ($file.Name -match '\.ps1\.ps1$') { continue } # Skip if the file is a source generator.
34
. $file.FullName
4-
}
5+
}
56

67
$aliasNames = @()
78
foreach ($transpilerCmd in Get-Transpiler) {
@@ -11,7 +12,9 @@ foreach ($transpilerCmd in Get-Transpiler) {
1112
Set-Alias ".<$($transpilerCmd.DisplayName)>" Use-PipeScript
1213
}
1314

15+
$MyModule = $MyInvocation.MyCommand.ScriptBlock.Module
1416
foreach ($cmd in $ExecutionContext.SessionState.InvokeCommand.GetCommands('*','Function', $true)) {
17+
if ($cmd.ScriptBlock.Module -ne $MyModule) { continue }
1518
if ($cmd.ScriptBlock.Attributes.AliasNames) {
1619
$aliasNames += $cmd.ScriptBlock.Attributes.AliasNames
1720
}

0 commit comments

Comments
 (0)