lordmilko / PrtgXml

PowerShell library for generating PRTG EXE/Script Advanced Sensor responses
MIT License
30 stars 3 forks source link

Example with multiple results #3

Closed aaronaxvig closed 3 years ago

aaronaxvig commented 3 years ago

It would be nice to have an example in either docs/Prtg.md or docs/Result.md of what it would look like to have multiple result nodes.

lordmilko commented 3 years ago

Hi @aaronaxvig,

The "syntax" of PrtgXml simply consists of functions and script blocks. As such, you can generate multiple result nodes by specifying a loop, writing them manually, or any other means that is valid PowerShell

Prtg {
    Result {
        ...
    }

    Result {
        ...
    }
}

Regards, lordmilko

aaronaxvig commented 3 years ago

Sure, I figured that out after sifting through the documentation for 5-10 minutes. I would have found the explanation and example that you provided above to be quite helpful.