hi LucD
since VMtools Is outdated on some VMs getting warnings and no output. can we modify the below to get boottime instead of uptime ?
$stat = 'sys.osuptime.latest'
$entity = Get-VM (get-content servers.txt)
Get-Stat -Entity $entity -Stat $stat -Realtime -MaxSamples 1 -ErrorAction SilentlyContinue | Select @{N='VM';E={$_.Entity.Name}}, @{N='Uptime (d.hh:mm:ss)';E={[timespan]::FromSeconds($_.value)}}
this I got from you and works perfectly in getting uptime.