Skip to content

Instantly share code, notes, and snippets.

@anton-dudarev
Forked from AndrewPla/New-TempDirectory
Created December 29, 2019 12:48
Show Gist options
  • Save anton-dudarev/10ca869e6d89bb3685e42a378c646068 to your computer and use it in GitHub Desktop.
Save anton-dudarev/10ca869e6d89bb3685e42a378c646068 to your computer and use it in GitHub Desktop.
Cross-platform function to create temp folders. Created by Justin Grote https://twitter.com/JustinWGrote/status/1190311627746267136
function New-TempDirectory {
$pathToCreate = join-path ([io.path]::GetTempPath()) ([io.path]::GetRandomFileName())
New-Item -ItemType Directory -Path $pathToCreate
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment