Reply to Message

View discussion in a popup

Replying to:
Zsoldier
Expert
Expert

So then you can use Brent's suggestion.  Just add the -runasync switch to make it run like a queued job.  Like so:

$filepath = "D:\PathtoCSV\filename.csv

$csvobj = import-csv $filepath

foreach ($row in $csvobj) {

     $vmobj = get-vm $row.vmname

     $ds = get-datastore $row.destds

     $vmobj | move-vm -datastore $ds -runasync -confirm:$false

     }

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier
Reply
0 Kudos