VMware Cloud Community
chicagovm
Enthusiast
Enthusiast
Jump to solution

PowerCLI 5.0 - Get VM and Datastore information

I am trying to attain the list of VMs and their Datastores in a particular cluster. It seems the Datastore Name is not resulting.. Any ideas?

PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> Get-Cluster "clustername" | Get-VM -Name * | Get-HardDisk | Export-Csv -NoTypeInform

ation c:\Scripts\***.csv

Reply
0 Kudos
1 Solution

Accepted Solutions
chicagovm
Enthusiast
Enthusiast
Jump to solution

Get-Cluster **** | Get-VM | Select Name,
@{N="Cluster";E={Get-Cluster -VM $_}}, `

@{N="ESX Host";E={Get-VMHost -VM $_}}, `

@{N="Datastore";E={Get-Datastore -VM
$_}}

View solution in original post

Reply
0 Kudos
1 Reply
chicagovm
Enthusiast
Enthusiast
Jump to solution

Get-Cluster **** | Get-VM | Select Name,
@{N="Cluster";E={Get-Cluster -VM $_}}, `

@{N="ESX Host";E={Get-VMHost -VM $_}}, `

@{N="Datastore";E={Get-Datastore -VM
$_}}

Reply
0 Kudos