Hello all,
I need help with pulling VMs from a csv and then run the following script
Get-VM | Select Name, @{N="Datastore";E={$_ | Get-Datastore}}
You mean something like this?
# CSV layout # # Name # vm1 # vm2 Import-Csv -Path .\vmnames.csv -PipelineVariable row | ForEach-Object -Process { Get-VM -Name $row.Name | Select Name, @{N="Datastore";E={($_ | Get-Datastore).Name}} }
Exactly! Thank you