summaryrefslogtreecommitdiffstats
path: root/tests/syntax-tests/highlighted/PowerShell/test.ps1
blob: 915b6072f3eb63f4d7543200f8d03f31800c8533 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# PowerShell script for testing syntax highlighting

function Get-FutureTime {
    param (
        [Int32] $Minutes
    )
    
    $time = Get-Date | % { $_.AddMinutes($Minutes) }
    "{0:d2}:{1:d2}:{2:d2}" -f @($time.hour, $time.minute, $time.second)
}

if ($env:PATH -match '.*rust.*') {
   'Path contains Rust'
    try {
        & "cargo" "--version"
    } catch {
        Write-Error "Failed to run cargo"
    }
} else {
   'Path does not contain Rust'
}

(5..30) | ? { $_ % (2 * 2 + 1) -eq 0 } | %[38;2;248