PowerShell Snippets: Delete File

PowerShellThis post is part of the series on PowerShell Snippets.

The following PowerShell command will check if the named file exists in the current directory and, if so, delete it (replace the highlighted section with the name of the file to be deleted):

$FileName = "azrcrv-smtp.zip"

if (Test-Path $FileName) {
Remove-Item $FileName
}

Continue Reading azurecurve’s Article on their blog

PowerShell Snippets: Delete File

This post is part of the series on PowerShell Snippets.

Blog Syndicated with azurecurve’s Permission

Author: Ian Grieve

Share This Post On
Share via
Copy link
Powered by Social Snap