【发布时间】:2019-03-10 10:36:24
【问题描述】:
我收到了一些关于如何使用此 PowerShell 脚本根据文件夹中的文件创建 txt 文件的极好的建议。
Get-ChildItem -Path "C:\Users\temp\" -Recurse -File |
Where-Object {$_.Extension -notin '.txt'} |
ForEach-Object {
[System.IO.File]::WriteAllText("C:\Users\temp\" + $_.BaseName + ".txt", $_.FullName)
}
如何修改此脚本以仅基于文件夹创建 txt 文件,而忽略这些文件夹中包含的文件?
谢谢!
【问题讨论】:
标签: powershell