Hi Luc,
can you please check why folowing code is not working .i am thinking to get found vms in $found.but its not happening for some reasons.
$strings=Import-Csv -Path 'C:\Users\administrator\desktop\add_srm1.csv'
$found=@()
$vms_prod_vcenter=(get-vm).name
foreach($vm in $strings)
{
$v= get-vm -name $vm.vmname
$v.name
if($vms_prod_vcenter -contains $v.name)
{
write-host "vm found" $v.name
$v.name += $found
}
}
$found