Skip to content

Commit 97d7d40

Browse files
StartAutomatingStartAutomating
authored andcommitted
Adding until keyword and tests (#146)
1 parent fbf5fa9 commit 97d7d40

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

docs/Until.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
2+
Until
3+
-----
4+
### Synopsis
5+
until keyword
6+
7+
---
8+
### Description
9+
10+
The until keyword simplifies event loops.
11+
12+
until will always run at least once, and will run until a condition is true.
13+
14+
---
15+
### Examples
16+
#### EXAMPLE 1
17+
```PowerShell
18+
{
19+
$x = 0
20+
until ($x == 10) {
21+
$x
22+
$x++
23+
}
24+
} |.>PipeScript
25+
```
26+
27+
#### EXAMPLE 2
28+
```PowerShell
29+
{
30+
until "00:00:05" {
31+
[DateTime]::Now
32+
Start-Sleep -Milliseconds 500
33+
}
34+
} | .>PipeScript
35+
```
36+
37+
#### EXAMPLE 3
38+
```PowerShell
39+
Invoke-PipeScript {
40+
$tries = 3
41+
until (-not $tries) {
42+
"$tries tries left"
43+
$tries--
44+
}
45+
}
46+
```
47+
48+
---
49+
### Parameters
50+
#### **CommandAst**
51+
52+
|Type |Requried|Postion|PipelineInput |
53+
|------------------|--------|-------|--------------|
54+
|```[CommandAst]```|true |named |true (ByValue)|
55+
---
56+
### Syntax
57+
```PowerShell
58+
Until -CommandAst <CommandAst> [<CommonParameters>]
59+
```
60+
---
61+
### Notes
62+
until will become a ```do {} while ()``` statement in PowerShell.
63+
64+
65+

0 commit comments

Comments
 (0)