Skip to content

Support Question: Unable to extract data from JSON file #11140

@AnthonyPaull

Description

@AnthonyPaull

Support Question

I've got a JSON file in this format:
[
{
"SensorApp": "HWiNFO",
"SensorClass": "System: DELL XPS 13 9380",
"SensorName": "Virtual Memory Commited",
"SensorValue": "7286",
"SensorUnit": "MB",
"SensorUpdateTime": 1574031681
},
{
"SensorApp": "HWiNFO",
"SensorClass": "System: DELL XPS 13 9380",
"SensorName": "Virtual Memory Available",
"SensorValue": "1926",
"SensorUnit": "MB",
"SensorUpdateTime": 1574031681
},
{
"SensorApp": "HWiNFO",
"SensorClass": "System: DELL XPS 13 9380",
"SensorName": "Virtual Memory Load",
"SensorValue": "79",
"SensorUnit": "%",
"SensorUpdateTime": 1574031681
}
]

Yet every time I convertfrom-JSON and try to get data out (In this case, trying to get temperature info from HWiNFO64), it returns as empty. I can format as a table and see all the data, however nothing I do seems to be able to parse the content of the file and return a value.

So my question here is how do I go about getting information (Say in this case, I want to find anything with sensorname -like tjmax and then return the sensorvalue from that object)

Any suggestions welcome. For reference I'd consider myself competent but not an expert. I'm really hoping there's an easy obvious way to do this that I just missed.

192.168.66.38.txt

Official support

PowerShell Support Lifecycle

Community Resources

Slack and Discord Community Chat - Interactive chat with other PowerShell enthusiasts. Both Slack and Discord are bridged via a bot and can seamlessly talk to each other.

StackOverflow.com and PowerShell.org Forum - Search or post new general PowerShell usage questions

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions