Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

PowerShell Export-Csv not as expected

hello, i am trying to export results as a table to a csv

 

Get-PowerBIWorkspace | Format-table | Export-Csv C:\Users\spaldg\Downloads\wksp.csv -NoTypeInformation

 

when displayed on screen (without the Export) it looks fine

screen.png

 

 

but when saved as a .csv, this is what i get

file.png

 

what am i doing wrong ?

thanks

g

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Generally you don't want to use Export-Csv - Write-Output  gives you better control over the result, especially for true CSV files.

But if you're sticking with Export-Csv, read this article

Why Can’t I Pipe Format-Table to Export-Csv (and get something useful)? | PowerShell (microsoft.com).

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

Please update the command line as follow and check whether you can get what you want:

Get-PowerBIWorkspace | Format-table | Export-Csv -Path C:\Users\spaldg\Downloads\wksp.csv -NoTypeInformation -Delim ";"

Export-Csv

Best Regards

lbendlin
Super User
Super User

Generally you don't want to use Export-Csv - Write-Output  gives you better control over the result, especially for true CSV files.

But if you're sticking with Export-Csv, read this article

Why Can’t I Pipe Format-Table to Export-Csv (and get something useful)? | PowerShell (microsoft.com).

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.