Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 180329

finding_list ofavailablevms_in totalvms_in_vcenter_powercli

$
0
0

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


Viewing all articles
Browse latest Browse all 180329

Trending Articles