Skip to content

Commit 8e7af5a

Browse files
StartAutomatingStartAutomating
authored andcommitted
Updating PipeScript module source (using #105, #106)
1 parent 27099cb commit 8e7af5a

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

PipeScript.psm1

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
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\.ps1$') { continue } # Skip if the file is a source generator.
3+
if ($file.Name -match '\.[^\.]\.ps1$') { continue } # Skip if the file is an unrelated file.
44
. $file.FullName
55
}
66

7-
$aliasNames = @()
8-
foreach ($transpilerCmd in Get-Transpiler) {
9-
$aliasNames += ".>$($transpilerCmd.DisplayName)"
10-
Set-Alias ".>$($transpilerCmd.DisplayName)" Use-PipeScript
11-
$aliasNames += ".<$($transpilerCmd.DisplayName)>"
12-
Set-Alias ".<$($transpilerCmd.DisplayName)>" Use-PipeScript
13-
}
7+
$transpilerNames = Get-Transpiler | Select-Object -ExpandProperty DisplayName
8+
$aliasList +=
9+
10+
@(foreach ($alias in @($transpilerNames)) {
11+
Set-Alias ".>$alias" "Use-PipeScript" -PassThru:$True
12+
})
13+
14+
15+
$aliasList +=
16+
17+
@(foreach ($alias in @($transpilerNames)) {
18+
Set-Alias ".<$alias>" "Use-PipeScript" -PassThru:$True
19+
})
20+
1421

1522
$MyModule = $MyInvocation.MyCommand.ScriptBlock.Module
16-
$aliasNames +=
23+
$aliasList +=
1724

1825
@(
1926
if ($MyModule -isnot [Management.Automation.PSModuleInfo]) {

0 commit comments

Comments
 (0)