Skip to content

Commit c0ded82

Browse files
StartAutomatingStartAutomating
authored andcommitted
Updating PipeScript.HelpOut.ps1 (including topics, re #132)
1 parent 5d93297 commit c0ded82

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

docs/README.ps1.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
1-
This directory and it's subdirectories contain syntax changes that enable common programming scenarios in PowerShell and PipeScript.
1+
This directory and it's subdirectories contain Transpilers that transform parameter attributes.
2+
3+
Parameter Transpilers do not need to take any values from the pipeline.
4+
They will be called by the Core PipeScript Transpiler ```PipeScript.ParameterAttribute```.
5+
6+
When Transpiling a Parameter, the Transpiler should return one of two things.
7+
8+
1. An empty ```[ScriptBlock]``` preceeded by attributes or help. This will replace the Transpiled attribute with a real one.
9+
2. A ```[Collections.IDictionary]``` can be used to send arguments directly back to ```Update-PipeScript```.
10+
11+
Many parameter transpilers can also apply to a ```[Management.Automation.Language.VariableExpressionAst]```.
12+
13+
When this is the case it is common for the transpiler to add a ```[ValidateScript]``` attribute to the variable. This will constraint the value of that variable.
14+
15+
## List Of Parameter Transpilers
216

317
~~~PipeScript{
418
[PSCustomObject]@{
519
Table = Get-Transpiler -TranspilerPath $pwd |
6-
Select-Object DisplayName, Synopsis, @{
20+
Select-Object DisplayName, @{
21+
Name='Synopsis'
22+
Expression= { $_.Synopsis -replace '[\s\r\n]+$' }
23+
}, @{
724
Name='Link'
825
Expression = { $_.Name }
926
}
10-
}}
27+
}
28+
}
1129
~~~
1230

1331

14-
~~~PipeScript{
15-
@(foreach ($transpiler in Get-Transpiler -TranspilerPath $pwd) {
16-
$examples = @($transpiler.Examples)
17-
if (-not $examples) { continue }
18-
for ($exampleNumber = 1; $exampleNumber -le $examples.Length; $exampleNumber++) {
19-
@("## $($transpiler.DisplayName) Example $($exampleNumber)",
20-
[Environment]::Newline,
21-
"~~~PowerShell",
22-
$examples[$exampleNumber - 1],
23-
"~~~") -join [Environment]::Newline
24-
}
25-
}) -join ([Environment]::Newline * 2)
26-
}
27-
~~~
32+

0 commit comments

Comments
 (0)