我试图将某些列连接到带有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
答案 0 :(得分:0)
$output123 ="$($userlist.Printer),$($userlist.CashDrawer)"