Get-View -ViewType "VirtualMachine" -Property @("Name", "Config.DatastoreUrl")| Select-Object -Property Name, @{N="DataStore";E={$_.Config.DatastoreUrl}}
Above is not giving datastore path .. any suggest what is missing ?
This works well for single vm tho
Hello, esxi1979-
By "datastore path", are you looking for for the names of the datastores on which the VM resides? If so, you can adjust that calculated property to something like:
Get-View -ViewType "VirtualMachine" -Property "Name", "Config.DatastoreUrl" | Select-Object -Property Name, @{N="DataStore";E={$_.Config.DatastoreUrl | %{$_.Name}}}
That do it?
Hello, esxi1979-
By "datastore path", are you looking for for the names of the datastores on which the VM resides? If so, you can adjust that calculated property to something like:
Get-View -ViewType "VirtualMachine" -Property "Name", "Config.DatastoreUrl" | Select-Object -Property Name, @{N="DataStore";E={$_.Config.DatastoreUrl | %{$_.Name}}}
That do it?