Safely Re-Create a Directory

If the directory exists, remove it before re-creating it.

function New-Directory($dir)
{
    if (Test-Path "$dir") {
        Remove-Item "$dir" -Recurse -Force
    }

    New-Item "$dir" -ItemType Directory -Force -Path
}