小编Dan*_*ams的帖子

Powershell:Export-CSV和OutFile没有达到我的预期

为什么我在这里得到一个空白文件?当我在export-csv之前运行它时,我得到的所有记录都显示在控制台中.

产量

所以这是我正在使用的代码

$path = "C:\test"

Get-ChildItem -Path $path -Include *.edi, *.x12, *.filename, *.dat, *.log, *.mdn, *.req -Recurse -Force |
Where-Object {!$_.PSIsContainer -and ((get-date)-$_.LastWriteTime).days -gt 30 } |
Remove-Item -force -whatif | export-csv D:\output.csv #also I try out-file D:\output.txt 
Run Code Online (Sandbox Code Playgroud)

powershell output export-csv

0
推荐指数
1
解决办法
270
查看次数

标签 统计

export-csv ×1

output ×1

powershell ×1