How do I parse the correct values from this powershell query using a discovery pattern?

Johannes
Kilo Sage

If I create a discovery pattern step "Parse Command Value", and in "Set Command Output" run the command 

powershell.exe get-mpcomputerstatus^|select-object amengineversion,amproductversion,antivirussignatureversion,AMRunningMode,AMServiceEnabled,QuickScanEndTime,DefenderSignaturesOutOfDate,AntivirusSignatureLastUpdated

 

I get the Output:

amengineversion                 : 1.1.24090.11

amproductversion                : 4.18.24090.11

antivirussignatureversion       : 1.421.1682.0

AMRunningMode                   : Normal

AMServiceEnabled                : True

QuickScanEndTime                : 2/4/2025 3:51:18 AM

DefenderSignaturesOutOfDate     : False

AntivirusSignatureLastUpdated   : 2/3/2025 10:36:45 PM

I want to put each of the values in the third column into each own variable.

I have tried some with both Regex and Delimited text, but am not able to isolate each value correctly.

e.g. if I use regex:

^(?<propName>\S+)\s*:\s*(?<propValue>.+)$

It only throws everything in my second variable:

Johannes_0-1738661026790.png

 

Any tips on how to solve this?

1 ACCEPTED SOLUTION

Johannes
Kilo Sage

Using "Delimited text" was working fine after all.

Johannes_1-1740044353714.png

 



I just had to reference the fields in the table correctly using column name and row number when setting the values.

Johannes_0-1740044321811.png

 

 

View solution in original post

1 REPLY 1

Johannes
Kilo Sage

Using "Delimited text" was working fine after all.

Johannes_1-1740044353714.png

 



I just had to reference the fields in the table correctly using column name and row number when setting the values.

Johannes_0-1740044321811.png