Can I get a script which allows me to get a list of VM's on a specfic datastore. I think you use the get-datastore command, but I dont how you would get the list of VM's
You use the pipeline
Get-Datastore -Name datastorename | Get-VM
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You use the pipeline
Get-Datastore -Name datastorename | Get-VM
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Can i combine this script or change it, which will give me all my datastores and their VM;s, so basically I can see for all my VM's what datastores they are on. Is there foreach command I have to use
Something like this you mean ?
foreach($ds in Get-Datastore){ foreach($vm in ($ds | Get-VM)){ $vm | Select @{N="VMname";E={$_.Name}}, @{N="DSName";E={$ds.Name}} } }
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference