Skip to content

Commit

Permalink
feat: Out-JSON ( Fixes #727 )
Browse files Browse the repository at this point in the history
    Adding Example
  • Loading branch information
StartAutomating authored and StartAutomating committed Mar 9, 2024
1 parent 1994336 commit 23267f8
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Tests/Examples/Template.PipeScript.Dot.examples.tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

describe 'Template.PipeScript.Dot' {
it 'Template.PipeScript.Dot Example 1' {
.> {
[DateTime]::now | .Month .Day .Year
}
}
it 'Template.PipeScript.Dot Example 2' {
.> {
"abc", "123", "abc123" | .Length
}
}
it 'Template.PipeScript.Dot Example 3' {
.> { 1.99 | .ToString 'C' [CultureInfo]'gb-gb' }
}
it 'Template.PipeScript.Dot Example 4' {
.> { 1.99 | .ToString('C') }
}
it 'Template.PipeScript.Dot Example 5' {
.> { 1..5 | .Number { $_ } .Even { -not ($_ % 2) } .Odd { ($_ % 2) -as [bool]} }
}
it 'Template.PipeScript.Dot Example 6' {
.> { .ID { Get-Random } .Count { 0 } .Total { 10 }}
}
it 'Template.PipeScript.Dot Example 7' {
.> {
# Declare a new object
.Property = "ConstantValue" .Numbers = 1..100 .Double = {
param($n)
$n * 2
} .EvenNumbers = {
$this.Numbers | Where-Object { -not ($_ % 2)}
} .OddNumbers = {
$this.Numbers | Where-Object { $_ % 2}
}
}
}
}

0 comments on commit 23267f8

Please sign in to comment.