PowerShell Delete Folder or Directory If Exist

Here is a powershell script for delete folder if folder is exist at their location.

$Folder="c:\Users\Administrator\Desktop\NewFolder"

If (Test-Path $Folder)
{
Remove-Item $Folder
}

Comments

Popular posts from this blog

C# Copy files from one server to another

Export SharePoint Online Group Users to Excel using Powershell