Skip to content

Commit 22d829e

Browse files
author
James Brundage
committed
More Dotting Examples (#107)
1 parent 0ec1153 commit 22d829e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Transpilers/Syntax/Dot.psx.ps1

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,21 @@
2626
.EXAMPLE
2727
.> { 1.99 | .ToString('C') }
2828
.EXAMPLE
29-
1..5 | .Number { $_ } .Even { -not ($_ % 2) } .Odd { ($_ % 2) -as [bool]}
29+
.> { 1..5 | .Number { $_ } .Even { -not ($_ % 2) } .Odd { ($_ % 2) -as [bool]} }
30+
.EXAMPLE
31+
.> { .ID { Get-Random } .Count { 0 } .Total { 10 }}
32+
.EXAMPLE
33+
.> {
34+
# Declare a new object
35+
.Property = "ConstantValue" .Numbers = 1..100 .Double = {
36+
param($n)
37+
$n * 2
38+
} .EvenNumbers = {
39+
$this.Numbers | Where-Object { -not ($_ % 2)}
40+
} .OddNumbers = {
41+
$this.Numbers | Where-Object { $_ % 2}
42+
}
43+
}
3044
#>
3145
[ValidateScript({
3246
$commandAst = $_

0 commit comments

Comments
 (0)