Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I do know that the info found in the msinfo32.exe file is available via native Powershell commandlets. However, I have a particular need to parse the data from a msinfo32.txt file for two or three attributes.

As the file is an xml format, I thought I would try using Powershell to retrieve the data.


I've added the contents of the file to a variable ($msinfo):

[xml]$msinfo = Get-Content msinfo32-TEMPLATE.nfo


I get as far as reading the final 'Data' child, however I am not sure how to select values I'm interested in...

PS C:\temp\xml> $msinfo.MsInfo.Category

name Data Category
---- ---- --------
System Summary {Data, Data, Data, Data... {Hardware Resources, C...



PS C:\temp\xml> $msinfo.MsInfo.Category

name Data Category
---- ---- --------
System Summary {Data, Data, Data, Data... {Hardware Resources, C...




I've looked at MSDN's book.xml file and used that to check info, and it seems to do what I need.

I'm slightly confused and any pointers to an article / link explaining what is needed, would be appreciated.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900