Test/test007.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

BEGIN
{
    # the definition of Out-TestLog
    . ./Common.ps1
    $TESTNAME = $MyInvocation.MyCommand
    $name = "Microsoft.windows.computer"
    $STARTTIME = [datetime]::Now
}
END
{

    try
    {
        $o = get-scsmannouncement
        if ( $null -ne $o ) { Out-TestLog ("PASS: " + [datetime]::Now + ":${TESTNAME}" ) }
    }
    catch 
    {
        Out-TestLog ("FAIL: " + [datetime]::Now + ":${TESTNAME}" )
        $error | %{ Out-TestLog (" DETAIL: " + $_ ) }
        return 1
    }

    return 0

}