Tuesday, April 14, 2015

Creating folder using PowerShell script

$FolderPath = (get-location).Path + "\FolderName\"

createFolder $FolderPath

function createFolder($FolderName)
{
      if(!(Test-Path -Path $folderName))
        {
            New-Item -ItemType directory -Path $folderName
            Write-Host("$folderName folder created!")
        }
}