Quantcast
Viewing all articles
Browse latest Browse all 217522

Re: ESX / DATASTORE details in inventory list.

Hello-

 

You can use the "call" operator (the ampersand -- "&") and a script block (a set of curly braces -- "{  }") to get the output to the pipeline, and on to Export-Csv (or whatever else you choose), like:

 

&{
Get-VMHost | Foreach-Object {
   
## get the GenericMeasureInfo for this host's datastores, to be used for the output
    $mioThisHostsDStoreInfo= ...
    ...
}
## end foreach-object
} | Export-Csv-Path"VMs.csv"-NoTypeInformation-UseCulture

 

Note the &{ at the start, and the additional } after the close of the Foreach-Object statement (and, I left the body of the Foreach-Object statement out -- that should just be the same as the previous post I made, but I left it off here to help highlight what is actually different).

 

And, the "uncommitted space":  that is just a separate statistic that lets you know how much additional disk _might_ be used, if there are thin virtual disks on the datastores (referring to how much space they have been allocated but that they have not yet used).  You are correct, those other three values are present, and you needn't use/report on uncommitted.  I was just pointing it out, in case thin provisioning is in play.

 

Anyway, how does that do?


Viewing all articles
Browse latest Browse all 217522

Trending Articles