title: Run Powershell script file located on a UNC path with parameters
body: <p>There is a PowerShell script that need to be run from a UNC path. i.e. \\myserver\folder\a.ps1. The script takes a parameter. The first few lines of the script are as below</p>
  
  <pre><code>param(
  [Parameter(Mandatory)]
  [ValidateSet('DEV','TEST','STAGING')]    
  [String]$Server
  )
  </code></pre>
  
  <p>But when I type \\myserver\folderA\a.ps1 -S in a PowerShell window on my computer and hit tab auto-completion won't work nor does the validate set( Server parameter won't be bound to the argument path). If I copy the script locally and try this auto-completion and validateset works. What should I do to be able to call the script by a UNC path and still get the validate set to work? Thanks.</p>