PowerShell: Array to String

By Xah Lee. Date: . Last updated: .

Operator: -join

# join array items to a single string
$x= @( "a", "b", "c" );
($x -join ";") -eq "a;b;c"

Cast Type to String

# array to string
[string] @(1, 2, 3) -eq "1 2 3"

PowerShell: Array