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' –