Question

Im trying to join certain columns into a comma delimited array with powershell.

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

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

echo $output123

That gives me

Printer POS IBM4610-TF6 Cash Drawer POS IBM

But i want it

Printer POS IBM4610-TF6,Cash Drawer POS IBM
Était-ce utile?

La solution

$output123 ="$($userlist.Printer),$($userlist.CashDrawer)"
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top