【发布时间】:2013-01-23 17:10:26
【问题描述】:
我正在尝试创建一天前的文件报告,我目前有一个包含文件名和日期的脚本:
get-childitem -Path \\UNC_PATH_TO_FILE
| where-object {$_.lastwritetime -gt (get-date).addDays(-1)}
| Foreach-Object { $_.Name, $_.CreationTime }
以前我将它导出到每个 UNC 路径的文件中,但是现在它已经增长,将导致读取 22 个单独的文件。
我想将其合并到一个 CSV 文件中,该文件可以包含 Server、Filename ($_.Name) 和 Date ( $_.CreationTime)。
这超出了我的 Powershell 领域,找不到任何可以真正帮助我的东西。有人可以提供一些帮助吗?
【问题讨论】:
标签: powershell export-to-csv get-childitem