File tree Expand file tree Collapse file tree 2 files changed +99
-0
lines changed
Expand file tree Collapse file tree 2 files changed +99
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,22 @@ Invoke-PipeScript {
5959} -Verbose
6060```
6161
62+ #### EXAMPLE 5
63+ ``` PowerShell
64+ # assert can be used with the object pipeline. $_ will be the current object.
65+ Invoke-PipeScript {
66+ 1..4 | assert {$_ % 2} "$_ is not odd!"
67+ } -Debug
68+ ```
69+
70+ #### EXAMPLE 6
71+ ``` PowerShell
72+ # You can provide a ```[ScriptBlock]``` as the second argument to see each failure
73+ Invoke-PipeScript {
74+ 1..4 | assert {$_ % 2} { Write-Error "$_ is not odd!" }
75+ } -Debug
76+ ```
77+
6278---
6379### Parameters
6480#### ** CommandAst**
Original file line number Diff line number Diff line change 1+
2+ Inline.YAML
3+ -----------
4+ ### Synopsis
5+ Yaml File Transpiler.
6+
7+ ---
8+ ### Description
9+
10+ Transpiles Yaml with Inline PipeScript into Yaml.
11+
12+ Because Yaml does not support comment blocks, PipeScript can be written inline inside of specialized Yaml string.
13+
14+ PipeScript can be included in a multiline Yaml string with the Key PipeScript and a Value surrounded by {}
15+
16+ ---
17+ ### Examples
18+ #### EXAMPLE 1
19+ ``` PowerShell
20+ {
21+ $yamlContent = @'
22+ PipeScript: |
23+ {
24+ @{a='b'}
25+ }
26+ ```
27+ List:
28+ - PipeScript: |
29+ {
30+ @{a='b';k2='v';k3=@{k='v'}}
31+ }
32+ - PipeScript: |
33+ {
34+ @(@{a='b'}, @{c='d'})
35+ }
36+ - PipeScript: |
37+ {
38+ @{a='b'}, @{c='d'}
39+ }
40+ '@
41+ [ OutputFile('.\HelloWorld.ps1.yaml')] $yamlContent
42+ }
43+
44+ .> .\HelloWorld.ps1.yaml
45+ ---
46+ ### Parameters
47+ #### ** CommandInfo**
48+
49+ The command information. This will include the path to the file.
50+
51+
52+
53+ | Type | Requried| Postion| PipelineInput |
54+ | --------------| --------| -------| --------------|
55+ | ``` [Object] ``` | true | 1 | true (ByValue)|
56+ ---
57+ #### ** Parameter**
58+
59+ A dictionary of parameters.
60+
61+
62+
63+ | Type | Requried| Postion| PipelineInput|
64+ | -------------------| --------| -------| -------------|
65+ | ``` [IDictionary] ``` | false | 2 | false |
66+ ---
67+ #### ** ArgumentList**
68+
69+ A list of arguments.
70+
71+
72+
73+ | Type | Requried| Postion| PipelineInput|
74+ | ------------------| --------| -------| -------------|
75+ | ``` [PSObject[]] ``` | false | 3 | false |
76+ ---
77+ ### Syntax
78+ ``` PowerShell
79+ Inline.YAML [-CommandInfo] <Object> [[-Parameter] <IDictionary>] [[-ArgumentList] <PSObject[]>] [<CommonParameters>]
80+ ```
81+ ---
82+
83+
You can’t perform that action at this time.
0 commit comments