Test/test003.ps1

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
26
27
28
29
30
31
32
33
34
BEGIN
{
    # the definition of Out-TestLog
    . ./Common.ps1
    $TESTNAME = $MyInvocation.MyCommand
    $STARTTIME = [datetime]::Now
}
END
{
try
{
    $a = get-scsmRule
    foreach($rule in $a)
    {
        $b = [smlets.workflowhelper]::GetJobStatus($rule)
        # once we have a winner, don't continue
        if ( $b ) 
        { 
            if ( $b[0] -ne $null )
            {
                Out-TestLog ("PASS:" + [datetime]::now + ":${TESTNAME}")
                return 0
            }
        }
    }
}
catch
{
    Out-TestLog ("FAIL:" + [datetime]::now + ":${TESTNAME}")
    Out-TestLog (" DETAILS: " + $error[0])
    return 1
}
}