This code creates a comma-separated file, I need to convert that to the pipe-delimited format. How to do that?
$DataSet.Tables[0] | Export-csv "G:\Text.txt" -NoTypeInformation
Use the -delimiter
parameter specified in the online help for export-csv
$DataSet.Tables[0] | Export-csv "G:\Text.txt" -NoTypeInformation -delimiter "|"