Skip to content

Commit c05ae17

Browse files
author
James Brundage
committed
Merge branch 'PipeScriptUpdates' of https://github.com/StartAutomating/PipeScript into PipeScriptUpdates
2 parents 6db0150 + 1730690 commit c05ae17

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Transpilers/Keywords/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,26 @@ Most keywords will be implemented as a Transpiler that tranforms a CommandAST.
5252
} -Verbose
5353
~~~
5454

55+
## Assert Example 5
56+
57+
58+
~~~PowerShell
59+
# assert can be used with the object pipeline. $_ will be the current object.
60+
Invoke-PipeScript {
61+
1..4 | assert {$_ % 2} "$_ is not odd!"
62+
} -Debug
63+
~~~
64+
65+
## Assert Example 6
66+
67+
68+
~~~PowerShell
69+
# You can provide a ```[ScriptBlock]``` as the second argument to see each failure
70+
Invoke-PipeScript {
71+
1..4 | assert {$_ % 2} { Write-Error "$_ is not odd!" }
72+
} -Debug
73+
~~~
74+
5575
## New Example 1
5676

5777

0 commit comments

Comments
 (0)