PowerShell

From Torben's Wiki

get substring of string

$var = 'Hello World'
$result = $var.substring(0, 5)
$result-> Hello

merge that substring with another sting

$dest = $rootPath + "\" +$subFolder

check a dir exists

if (Test-Path $dest) {
   Write-Host "We have the dir"
}

if not create

New-Item -ItemType directory -Path C:\tmp\newDir