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}}
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
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}}
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Exactly! Thank you