Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含文件路径和文件名(以及其他一些字段)的 csv。如何使用文件中的路径删除目录中的文件?
您需要导入文件并使用Remove-Itemcmdlet。假设您有一个名为“Path”的列,其中包含文件的完整路径:
Remove-Item
Import-Csv .\files.Csv | Foreach-Object{ Remove-Item -LiteralPath $_.Path -Force }