Hello, Jon2597-
You can use the Where-Object cmdlet to filter which items are returned. To filter on the the items you said (VMs where LastBootTime is less than 24 hours ago, and exclude VMs from the cluster "Test Cluster"), try something like:
## hash table to be used in calculated property
$LastBootProp = @{
Name = 'LastBootTime'
Expression = {(Get-Date) - (New-TimeSpan -Seconds $_.Summary.QuickStats.UptimeSeconds)}
}
## number of hours to which to compare gap since last boot
$intHoursToGoBack = 24
## get VM .Net View objects where time since last boot is less than 24 hours
Get-Cluster | Where-Object {$_.Name -ne "Test Cluster"} | Get-VM | Get-View -Property Name, Summary.QuickStats.UptimeSeconds | select Name, $LastBootProp | Where-Object {$_.LastBootTime -and ((New-Timespan -End (Get-Date) -Start (Get-Date $_.LastBootTime)).TotalHours -lt $intHoursToGoBack)}
That gets cluster where the cluster name is not equal to "Test Cluster", gets their VMs, gets a .Net View object of the VMs (with a few select properties), and displays the ones where the last boot time is within the last 24 hours. A bit convoluted vs. just getting VMs whose uptime is less than 24 hours, but should give the same results. The output would be something like:
Name LastBootTime
---- ------------
myVM01 6/12/2012 8:21:42 AM
myVM03 6/12/2012 6:50:37 AM
...
Work out for you ok?