title: How to have a Powershell validatescript parameter pulling from an array?
body: <p>I have a module with a lot of advanced functions. 
  I need to use a long list of ValidateSet parameters.
  I would like to put the whole list of possible parameters in an array and then use that array in the functions themselves.
  How can I pull the list of the whole set from an array?</p>
  
  <pre><code>New-Variable -Name vars3 -Option Constant -Value @("Banana","Apple","PineApple")
  function TEST123 {
      param ([ValidateScript({$vars3})]
      $Fruit)
      Write-Host "$Fruit"
  }
  </code></pre>
  
  <p>The problem is that when I use the function it doesn't pull the content from the constant.</p>
  
  <pre><code>TEST123 -Fruit 
  </code></pre>
  
  <p>If I specify the indexed value of the constant then it works.</p>
  
  <pre><code>TEST123 -Fruit $vars3[1] 
  </code></pre>
  
  <p>It returns Apple.</p>