Skip to content

Commit 50af1bd

Browse files
StartAutomatingStartAutomating
authored andcommitted
Adding [CommandAst].IsPipedTo/From (Fixes #266)
1 parent dbd1ac7 commit 50af1bd

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

PipeScript.types.ps1xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,22 @@ for (
745745

746746
</GetScriptBlock>
747747
</ScriptProperty>
748+
<ScriptProperty>
749+
<Name>IsPipedFrom</Name>
750+
<GetScriptBlock>
751+
if ($this.Parent -isnot [Management.Automation.Language.PipelineAst]) { return $false }
752+
$this.Parent.PipelineElements.IndexOf($this) -lt ($this.Parent.PipelineElements.Count - 1)
753+
754+
</GetScriptBlock>
755+
</ScriptProperty>
756+
<ScriptProperty>
757+
<Name>IsPipedTo</Name>
758+
<GetScriptBlock>
759+
if ($this.Parent -isnot [Management.Automation.Language.PipelineAst]) { return $false }
760+
$this.Parent.PipelineElements.IndexOf($this) -gt 0
761+
762+
</GetScriptBlock>
763+
</ScriptProperty>
748764
<ScriptProperty>
749765
<Name>Parameter</Name>
750766
<GetScriptBlock>

0 commit comments

Comments
 (0)