How do I write the value of a single property of a object?

Question:

This is how my current script looks like:

The output of the file is:

I want it to be only the number so that I can make calculations.

Answer:

That is a pretty simple fix. Instead of selecting the LoadPercentage when running Get-WmiObject, just select the property when calling your function. This will write only the number to your log file.

Source:

How do I write the value of a single property of a object? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply