Skip to content

Instantly share code, notes, and snippets.

@szemmali
Created January 6, 2019 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save szemmali/7cd2fee9f3563bc4b2078335db98ca62 to your computer and use it in GitHub Desktop.
Save szemmali/7cd2fee9f3563bc4b2078335db98ca62 to your computer and use it in GitHub Desktop.
function vcollect-check-folder ($dir) {
$dateF = Get-Date -UFormat "%d-%b-%Y_%H-%M-%S"
if(!(Test-Path -Path $report$dir )){
New-Item -ItemType directory -Path t$dir
Write-Host "New Storage folder created" -f Magenta
New-Item -Path $report$dir -Name $dateF -ItemType "directory"
Write-Host "New Work folder created" -f Magenta
}
else{
Write-Host "Storage Folder already exists" -f Green
New-Item -Path $report$dir -Name $dateF -ItemType "directory"
Write-Host "New Work folder created" -f Magenta
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment