How do I convert a HashSet<T> to an array in .NET?
How do I convert a HashSet<T> to an array in .NET?
Now you can do it even simpler, with List<T> constructor (Lists are modern Arrays :).
E. g., in PowerShell:
$MyNewArray = [System.Collections.Generic.List[string]]::new($MySet)