title: PowerShell loop using input variables
body: <p>First off, I'm a complete idiot when it comes to PowerShell/coding in general, so apologies if this is an overly simple question I'm asking.</p>
  
  <p>I've got a script that I'm using to create distribution lists in exchange via PowerShell:</p>
  
  <pre><code>param($name,$user=$(throw "You must specify the name of the group"))
  New-DistributionGroup -Name $name -OrganizationalUnit "XXX.com/Distribution Lists"
  Add-DistributionGroupMember -Identity "$name" -Member "$user"
  </code></pre>
  
  <p>The first variable, $name, is the name of the group, and the second, $user, is the name of the user to add to the group.</p>
  
  <p>Ideally I'd like to loop the adding of users so someone could evoke the script using <code>./script GROUPNAME User1 User2 User3 User4 User5</code>.</p>
  
  <p>Could anyone shed any insight or point me in the right direction?</p>