Skip to content

Commit 27099cb

Browse files
author
James Brundage
committed
Updating PipeScript module source (using #105, #106)
1 parent 865b539 commit 27099cb

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

PipeScript.ps1.psm1

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
[Include('*-*')]$psScriptRoot
22

3-
$aliasNames = @()
4-
foreach ($transpilerCmd in Get-Transpiler) {
5-
$aliasNames += ".>$($transpilerCmd.DisplayName)"
6-
Set-Alias ".>$($transpilerCmd.DisplayName)" Use-PipeScript
7-
$aliasNames += ".<$($transpilerCmd.DisplayName)>"
8-
Set-Alias ".<$($transpilerCmd.DisplayName)>" Use-PipeScript
9-
}
3+
$transpilerNames = Get-Transpiler | Select-Object -ExpandProperty DisplayName
4+
$aliasList +=
5+
[SmartAlias(Command='Use-PipeScript',Prefix='.>',PassThru)]$transpilerNames
6+
7+
$aliasList +=
8+
[SmartAlias(Command='Use-PipeScript',Prefix='.<',Suffix='>',PassThru)]$transpilerNames
109

1110
$MyModule = $MyInvocation.MyCommand.ScriptBlock.Module
12-
$aliasNames +=
11+
$aliasList +=
1312
[GetExports("Alias")]$MyModule
1413

1514
Export-ModuleMember -Function * -Alias $aliasNames

0 commit comments

Comments
 (0)