【发布时间】:2013-02-22 01:30:55
【问题描述】:
我正在尝试为具有深层文件夹结构的文件共享创建 CSV 文件。
我希望 CSV 看起来像:
filename, filepath, file type, folderStructure
到目前为止,我有以下内容:
#Get-ChildItem -Path D:\ -Recurse
$directory="d:\"
gci $directory -recurse |
where {$_.psiscontainer} |
foreach {
get-childitem $_.fullname |
sort creationtime |
select -expand fullname -last 1
}
【问题讨论】:
-
你能伪造你希望输出的样子吗?例如:image.png、D:\images、.png、D:\images lister.csv、D:\images\Lists\、.csv、D:\images\Lists
-
我明白,但是你能做一些数据吗(格式可以假)所以我确认你想要什么?特别是文件夹结构。你想要 D:\ +images ++image1.jpg +lists ++Exports +++export1.xlsx +++Export4.csv
标签: powershell directory enumerate