We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fa751a commit 5107aebCopy full SHA for 5107aeb
1 file changed
docs/Assert.md
@@ -59,6 +59,22 @@ Invoke-PipeScript {
59
} -Verbose
60
```
61
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
72
+# You can provide a ```[ScriptBlock]``` as the second argument to see each failure
73
74
+ 1..4 | assert {$_ % 2} { Write-Error "$_ is not odd!" }
75
76
77
78
---
79
### Parameters
80
#### **CommandAst**
0 commit comments