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

how to append the csv file

$
0
0

Hi all,

  Thanks in advance.

         In the following script how to append the csv file. I am trying to get datastore details of the list of vms in the csv file.

     Add-PSSnapin VMware.VimAutomation.Core
Connect-VIServer 192.168.1.125

##VMname.csv having list of vms ####
$vm = Import-csv c:\scripts\vmname.csv
     foreach ($line in $vm) {
         Get-datastore -vm $line.name | Select-Object $line.name,name,FreeSpaceGB | Export-Csv c:\scripts\ds.csv -NoTypeInformation
  }

Not able to append the result to my csv file. Also I need to add the vms os type of each vm. Please help.

 

Thanks


Viewing all articles
Browse latest Browse all 232869

Trending Articles