Hey guys I know this is a really easy thing but for some reason it's something I can't figure out. How would I go about getting just the numerical value from a measure--object command? Say I run get-vm |measure-object MemoryMB -Sum, I just want to the value for the sum not all the test that goes along with it. Is there an easy way to accomplish this? Thanks, example below:
Result:
Count : 123
Average :
Sum : 461112
Maximum :
Minimum :
Property : MemoryMB
All I want is: 461112
You can do
(get-vm |measure-object MemoryMB -Sum).Sum
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You can do
(get-vm |measure-object MemoryMB -Sum).Sum
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
This would also work:
get-vm | measure-object MemoryMB -Sum | %{$_.sum}