Hello,
I've been using Pester and have been look at using it for operational validation of managed devices, e.g. run down a sheet of if a system is accessible via WMI, RPC, Registry, WinRM, SNMP, etc.
I have a proof-of-concept Gist here:
My one question is, is there a native ability in pester to include output with a test?
For instance, say I have this test output:
Describing Windows Remote Management
[+] Responds to RPC TCP Port within 3 seconds 46ms
[+] Returns a WMI Computer Make and Model within 3 seconds 163ms
Is there any way to add what the Computer Make and Model actually were to the test result information? I care less about having it in the "write-host" output as I do having it in the XML or as an output object that comes out via -PassThru for instance.
The closest I've gotten so far is using write-verbose in the test and running with $VerbosePreference as "Continue", so it looks like this:
Describing Windows Remote Management
[+] Responds to RPC TCP Port within 3 seconds 46ms
[+] Returns a WMI Computer Make and Model within 3 seconds 163ms
VERBOSE: Host Manufacturer: Microsoft Corporation
VERBOSE: Host Model: Surface Pro 3
But what I'd really like is something like this:
[+] Responds to RPC TCP Port within 3 seconds 46ms
[+] Returns a WMI Computer Make and Model within 3 seconds 163ms
OUTPUT: Host Manufacturer: Microsoft Corporation
OUTPUT: Host Model: Surface Pro 3
That would also include that information into the XML output file.
Is there something native in Pester for this? I just can't find it in the documentation so I thought I'd ask before I go trying to code it myself.