There are several ways to populate an array.
$array = @"
$array = "host1",host2","host3"
I'm afraid you can stop/start the SNMP service from PowerCLI.Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
Btw, you can't restart the SNMP service on ESXi host but you can enable/disable it with PowerCLI.
Connect to the ESXi server (not the vCenter) and do
Get-VMHostSnmp | Set-VMHostSnmp -Enabled:$true -AddTarget -TargetHost "myHost" -TargetCommunity "public"
Get-VMHostSnmp | Set-VMHostSnmp -Enabled:$false
In fact why do you need to stop/start the SNMP service ?
You can change target hosts, communities ... on the fly.
Update: just did a bit of recerse-engineering on the vicfg-snmp.pl file.
And in fact what is called Stop and Start in that script is the -Enable:$true and -Enable:$false on the Set-VMHostSnmp cmdlet.
So, you can do exactly the same thing with PowerCLI.Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz