File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
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.
3
4
. $file.FullName
4
- }
5
+ }
5
6
6
7
$aliasNames = @ ()
7
8
foreach ($transpilerCmd in Get-Transpiler ) {
@@ -11,7 +12,9 @@ foreach ($transpilerCmd in Get-Transpiler) {
11
12
Set-Alias " .<$ ( $transpilerCmd.DisplayName ) >" Use-PipeScript
12
13
}
13
14
15
+ $MyModule = $MyInvocation.MyCommand.ScriptBlock.Module
14
16
foreach ($cmd in $ExecutionContext.SessionState.InvokeCommand.GetCommands (' *' , ' Function' , $true )) {
17
+ if ($cmd.ScriptBlock.Module -ne $MyModule ) { continue }
15
18
if ($cmd.ScriptBlock.Attributes.AliasNames ) {
16
19
$aliasNames += $cmd.ScriptBlock.Attributes.AliasNames
17
20
}
You can’t perform that action at this time.
0 commit comments