I want to format the the output from a sql query that is run in powershell.
The script I have right now is very basic:
sqlcmd -S {Server} -d (Database) -b -Q "sp_whoisactive" | format-table
Ideally I would like to ensure that the output is in a readable format such as
Column 1 Column 2 Column 3
Data Data2 Data3
However right now the data is all over the place and impossible to read and does not include any of the column names.
How I can accomplish this?