PS: Remove File If Existence

PS: Remove File If Existence

Using an IF statement to delete file if it exists pretty simple and small bit of code very hand to have

$FileLocation = "C:\TestFolder\Textdoctoberemoved.txt"
If (Test-Path $FileLocation){
	Remove-Item $FileLocation
}
Advertisements