加入数组逗号分隔符powershell

时间:2014-05-02 02:01:07

标签: powershell csv join printing import

我试图将某些列连接到带有PowerShell的逗号分隔数组。

$userlist = Import-Csv C:\POS.csv | Where-Object {($_.StoreId -eq "4801") -and ($_.TouchPointID -eq "10")} 

$output123 = -join "$($userlist.Printer) $($userlist.CashDrawer)"

echo $output123

那给了我

Printer POS IBM4610-TF6 Cash Drawer POS IBM

但我想要它

Printer POS IBM4610-TF6,Cash Drawer POS IBM

1 个答案:

答案 0 :(得分:0)

$output123 ="$($userlist.Printer),$($userlist.CashDrawer)"