Powershell Scripting - Building Blocks

Check and create directory if it doesn’t exist

$SourceDir = "directoryName"
if (!(Test-Path -Path $SourceDir ))
{
    Write-Host "Creating .\src directory" -ForegroundColor Green
    New-Item -ItemType directory -Path $DOCDIR\MatchedLog
}