Export-CSV exports length but not name

前端 未结 5 1256
迷失自我
迷失自我 2020-11-28 12:23

I have this code that I am running from powershell. When I run it without the export-csv i get all the folder names on the screen.

dir | select -expand fulln         


        
5条回答
  •  离开以前
    2020-11-28 13:08

    Export-Csv exports a table of object properties and their values. Since your script is producing string objects, and the only property they have is length, that's what you got.

    If you just want to save the list, use Out-File or Set-Content instead of Export-Csv.

提交回复
热议问题