Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Property collection System.String into new object(s)

$
0
0

I often find myself in a situation where I find some object property being a collection especially of type System.String if I put that right. Eg. when going through event logs we have the property Message which looks like it has nice names for each component yet it's a single string. Eg.: 

 

Id = {F0F71B23-BFF1-001B-B066-F8F0F1BFD101}; ClientMachine = SRV1; User = NT AUTHORITY\SYSTEM; ClientProcessId = 3224; Component = U

nknown; Operation = Start IWbemServices::ExecQuery - root\wmi : SELECT * FROM IntlLan_DuplexStatus; ResultCode = 0x80041010; PossibleCause

= Unknown

I'd like to turn that into a collection of objects like ID, ClientMachine; User etc. How can this be done?


Viewing all articles
Browse latest Browse all 6937

Trending Articles