Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 250391

powercli script to create array of virtual machines from text file input

$
0
0

Hi first time post / ask something here.  I am new to powercli and would appreciate some asstiance with the above.  To To clarify I would like to;

 

Read a list of virtual machine names from a .txt file OR possibly a .csv (as i attempted below) file into an Arrary.

 

I made an attempt with the following that failed

 

$vms = @()

for (i$ in (import-csv vmlist.csv)) {$vms += get-vm -name i$}

 

Example Text File.

 

virtualMachine1

virtualMachine2

virtualMachine3

 


Viewing all articles
Browse latest Browse all 250391

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>