Skip to content

Commit cba073c

Browse files
StartAutomatingStartAutomating
authored andcommitted
Adding PipeScript.Template (Fixes #315)
1 parent 0183565 commit cba073c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

PipeScript.types.ps1xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,6 +1174,24 @@ else {
11741174
"Function"
11751175
}
11761176

1177+
</GetScriptBlock>
1178+
</ScriptProperty>
1179+
<ScriptProperty>
1180+
<Name>Template</Name>
1181+
<GetScriptBlock>
1182+
$potentialTemplatePaths =
1183+
@(
1184+
$this.Source -replace '\.ps1$', '.ps.ps1'
1185+
$this.Source -replace '\.ps1$', '.ps1.ps1'
1186+
)
1187+
1188+
foreach ($potentialTemplatePath in $potentialTemplatePaths ) {
1189+
if (Test-Path $potentialTemplatePath) {
1190+
return (Get-PipeScript -PipeScriptPath $potentialTemplatePath)
1191+
}
1192+
}
1193+
1194+
11771195
</GetScriptBlock>
11781196
</ScriptProperty>
11791197
</Members>

0 commit comments

Comments
 (0)