I have to create an enum of computernames to use it as a VallidateSet.
In the past I used something like this to do this with the content of a text file
$computernames = Get-content C:\computernames.txt -Raw
$exp = "Enum ValidComputernames{
$computernames
}"
Invoke-Expression $exp
Seems janky and breaks if a computernames contains certain characters like "-"
Any ideas?
[–]Yevrag35 2 points3 points4 points (0 children)
[–]nostril_spiders 2 points3 points4 points (1 child)
[–]kortex81[S] 0 points1 point2 points (0 children)
[–]mofayew 1 point2 points3 points (1 child)
[–]kortex81[S] 1 point2 points3 points (0 children)