Execute SQL Stored Procedure and export results to CSV

$DataSet.Tables[0] | Export-CSV -notype path\file.csv

I’m guessing, I’m assuming that the last line outputs the table, I haven’t worked with MSSQL.