2

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

param(
[Parameter(Mandatory)]
[ValidateSet('DEV','TEST','STAGING')]    
[String]$Server
)

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.

yonaire
  • 21
  • 1
  • 2

0 Answers0