You can pass them on the command line:
myscriptname "server1" "server2" "server3"
Then remove the
line and replace the
loop reading from the file by
foreach ($computername in $args)
# Do the work here
If the cmdlet is called from another cmdlet where the list is stored in an array you can execute it as:
& myscriptname @ServerList
Invoke-Expression "myscriptname $ServerList"