Home POWERSHELL Remove a specific file in a folder and its subfolders with PowerShell

Remove a specific file in a folder and its subfolders with PowerShell

by Cengiz Kuskaya

Example :

The below powershell example search for a specific file in a specified folder and its subfolders and afterwards removes it.

Get-ChildItem -Path “D:\Folder\*” -Include “TestFile.txt” -Recurse | Remove-Item