Powershell script to delete a file if it already exists:
If (Test-Path $strFileName){ Remove-Item $strFileName }
See Also:
Powershell: Check If File Exists
Powershell: Delete Folder if Exists
Test-Path
Remove-Item
Powershell script to delete a file if it already exists:
If (Test-Path $strFileName){ Remove-Item $strFileName }
See Also:
Powershell: Check If File Exists
Powershell: Delete Folder if Exists
Test-Path
Remove-Item
Comments are closed.
Thanks!
Thank you!
Thanks. Your site gave me a perfect Google hit
works like a charm
works great!
you might want to check user input for asterisk *, otherwise, it will delete all your files in the current directory