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-Itemコマンドレットを使用する必要があります。ファイルへのフルパスを保持する「パス」という名前の列があると仮定します。
Remove-Item
Import-Csv .\files.Csv | Foreach-Object{ Remove-Item -LiteralPath $_.Path -Force }