Data Rows to String to Array issue
[String] $DBNms = @(); makes $DBNms a type-constrained variable, due to type literal [string] being placed to the left of variable $DBNms, whose type is then locked in as a string; that is, as a single string. You were looking to create a string array, which in PowerShell is represented as [string[]]: [string[]] $DBNames = … Read more