Passing multiple values to a single PowerShell script parameter
The easiest way is probably to use two parameters: One for hosts (can be an array), and one for vlan. Instead of you can use If there is only one host, the foreach loop will iterate only once. To pass multiple hosts to the script, pass it as an array: …or something similar.