Get-Childitem -path \\lettertext\BIZ -Recurse -Include *.txt |
ForEach-Object {
$Parts = $_.fullname.split('\')[4..7]
[PSCustomObject]@{
Customer = $Parts[0]
ClientGroup = $Parts[1]
Client = $Parts[2]
ClientDivision = $Parts[3]
FileName = $_.FullName | Split-Path -Leaf
}
} | Export-Csv c:\Letters\BIZ.csv -NoTypeInformation
上面的代码给我的文本文件在不同的文件夹,但我也想补充的最后修改日期和时间..谢谢我想上次修改的日期和时间添加到此PowerShell脚本
可以公开属性/什么获取-ChildItem以“get-childitem返回方法|获取member' –