Skip to content

Instantly share code, notes, and snippets.

@rikwatson
Created February 25, 2015 08:48
Show Gist options
  • Save rikwatson/d6291e7a360dbb74e1b1 to your computer and use it in GitHub Desktop.
Save rikwatson/d6291e7a360dbb74e1b1 to your computer and use it in GitHub Desktop.
Create (if necessary) & returns a folder on the users desktop of the format yyyy-mm-dd which can be used to export stuff into.
<#
Create (if necessary) & returns a folder on the users desktop of the format yyyy-mm-dd which
can be used to export stuff into.
#>
function _get_exportFolder
{
param()
$exportFolder = Join-Path (Join-Path $env:USERPROFILE "Desktop") (Get-Date -Format yyyy-MM-dd)
if (!(Test-Path $exportFolder))
{
New-Item -Path $exportFolder -ItemType directory | Out-Null
}
return $exportFolder
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment