Skip to content

Commit 4469522

Browse files
author
James Brundage
committed
Adding README for Parameter Transpilers
1 parent 919486a commit 4469522

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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
16+
17+
~~~PipeScript{
18+
[PSCustomObject]@{
19+
Table = Get-Transpiler -TranspilerPath $pwd |
20+
Select-Object DisplayName, @{
21+
Name='Synopsis'
22+
Expression= { $_.Synopsis -replace '[\s\r\n]+$' }
23+
}, @{
24+
Name='Link'
25+
Expression = { $_.Name }
26+
}
27+
}
28+
}
29+
~~~
30+
31+
32+

0 commit comments

Comments
 (0)