HI
I'm having trouble trying to get the following code to export to a csv file.
Get-Datastore |
Where-Object {$_.Name -notMatch ("ESX|Datastore1")} |
New-Object PSObject -Property @{
ClusterName = (Get-DatastoreCluster -Datastore $_ | Select -ExpandProperty Name)}},
@{N="DataStoreName";E={$_.name}},
@{N="Folder";E={Get-VM -Datastore $_ | Select -ExpandProperty folder}},
@{N="VMs";E={Get-VM -Datastore $_ | Select -ExpandProperty Name}} |
Please assist.
Thanks