Private/New-Workplace.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
function New-Workplace { do { $workplacePath=Read-Host "Get Path for Report:" $isPathCorrect=(([string]::IsNullOrWhiteSpace($workplacePath)) -or (Test-Path -Path $workplacePath -PathType Container)) } while ($isPathCorrect) New-Item -Path $workplacePath -ItemType Directory | Out-Null $workplacePath } |