You can get all the server names in an array then use Invoke-Command against the array of computers, and use the above code inside the scriptblock. I would suggest you to try this. You would use Get-Content and Invoke-Command cmdlets.
Connecting to remote server xxxxx failed with the following error message : WinRM cannot complete the operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and that a
firewall exception for the WinRM service is enabled and allows access from this computer. By default, the WinRM firewall exception for public profiles limits access to remote computers within the same local subnet. For more information, see the
about_Remote_Troubleshooting Help topic.
Can somebody tell me how secure it is to open this for on 200 vms?
Does the amount of machines make a difference?
It depends pretty much on your or your companies needs. You should do your own research. You might start with something from this: