Combine an array into a string with semicolon separator
$array = 'The','quick','brown','fox','jumps','over','the','lazy','dog.' $array -join(';')
Combine an array into a string with space separator
$array = 'The','quick','brown','fox','jumps','over','the','lazy','dog.' $array -join(' ')
Composite Format String
$string = 'The quick brown {0} jumps over the lazy {1}.' $string -f 'fox','dog'
Use StringBuilder to combine multiple strings
$stringBuilder = New-Object System.Text.StringBuilder for ($i = 0; $i -lt 10; $i++){ $stringBuilder.Append("Line $i`r`n") | Out-Null } $stringBuilder.ToString()
Combine multiple strings
$string1 = "The quick brown fox " $string2 ="jumps over the lazy dog" $string1 + $string2