You can use the -join
operator to convert a PowerShell list into a string format. Here's an example:
$list = "item1", "item2", "item3"
$string = $list -join ","
Write-Output $string
This will output: item1,item2,item3
In this example, we use the -join
operator to concatenate each item in the $list
variable with a comma ,
as a separator. The resulting string is then stored in the $string
variable.
Asked: 2022-10-17 11:00:00 +0000
Seen: 10 times
Last updated: Mar 10 '22