Answer the question
In order to leave comments, you need to log in
Weird Export-csv output from PowerShell. The reason, as I understand it, is not in the encoding, but in what?
Let's take this small script as an example:
Get-Service -Name "wuauserv" -ComputerName "server1", "server2", "server3" | FT -Property MachineName, Status, Name | Export-Csv -Path C:\tmp\wuausrv_status.csv -Delimiter ";" -Encoding Unicode
Answer the question
In order to leave comments, you need to log in
Don't use Format-Table when exporting. This cmdlet changes the display of output in the terminal, but does not change the object in the pipe. Instead, use Select-Object
Get-Service -Name "wuauserv" -ComputerName "server1", "server2", "server3" | Select-Object MachineName, Status, Name | Export-Csv -Path C:\tmp\wuausrv_status.csv -Delimiter ";" -Encoding Unicode -NoTypeInformation
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question