Skip to content

Commit d91750a

Browse files
Merge pull request #101 from StartAutomating/PipeScriptFixesAndFun
Pipe script fixes
2 parents 0aa1f4c + b4352dc commit d91750a

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Github/Actions/PipeScriptAction.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ $PSD1Found = Get-ChildItem -Recurse -Filter "*.psd1" | Where-Object Name -eq 'Pi
5656

5757
if ($PSD1Found) {
5858
$PipeScriptModulePath = $PSD1Found
59-
Import-Module $psd1Path -Force -PassThru | Out-Host
59+
Import-Module $PSD1Found -Force -PassThru | Out-Host
6060
} elseif ($env:GITHUB_ACTION_PATH) {
6161
$PipeScriptModulePath = Join-Path $env:GITHUB_ACTION_PATH 'PipeScript.psd1'
6262
if (Test-path $PipeScriptModulePath) {

PipeScript.ps1.psm1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ foreach ($transpilerCmd in Get-Transpiler) {
88
Set-Alias ".<$($transpilerCmd.DisplayName)>" Use-PipeScript
99
}
1010

11+
$MyModule = $MyInvocation.MyCommand.ScriptBlock.Module
1112
foreach ($cmd in $ExecutionContext.SessionState.InvokeCommand.GetCommands('*','Function', $true)) {
13+
if ($cmd.ScriptBlock.Module -ne $MyModule) { continue }
1214
if ($cmd.ScriptBlock.Attributes.AliasNames) {
1315
$aliasNames += $cmd.ScriptBlock.Attributes.AliasNames
1416
}

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ runs:
124124
125125
if ($PSD1Found) {
126126
$PipeScriptModulePath = $PSD1Found
127-
Import-Module $psd1Path -Force -PassThru | Out-Host
127+
Import-Module $PSD1Found -Force -PassThru | Out-Host
128128
} elseif ($env:GITHUB_ACTION_PATH) {
129129
$PipeScriptModulePath = Join-Path $env:GITHUB_ACTION_PATH 'PipeScript.psd1'
130130
if (Test-path $PipeScriptModulePath) {

0 commit comments

Comments
 (0)