$report = $vms.values | select-object Name, Powerstate, NumCpu, MemoryGB, Notes,
@{N="Cluster";E={$_.vmhost.parent}},
@{N="Last PowerOff";E={Get-VIEvent -Entity $_ -MaxSamples ([int]::MaxValue) | where {$_ -is [VMware.Vim.VmPoweredOffEvent]} | select createdTime}},
@{ n="Space on Datastore"; e={[math]::round( $_.ProvisionedSpaceGB, 2 )}} | convertto-html -Head $strHtmlHead
the Poweroff command bring out to much
it looks like this
@{CreatedTime=10/14/2019 10:47:14 AM}
How can I limit it to the Date only?
like-> 10/14/2019 10:47:14 AM
ps the imput $vmsvalues is a arry of VM´s
Use the ExpandProperty parameter
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Use the ExpandProperty parameter
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
oh wow,
you are a real scripting Boss!
Thanks