Powershell Util Functions

From UVOO Tech Wiki
Jump to navigation Jump to search

Tempdir

function New-TemporaryDirectory {
  $parent = [System.IO.Path]::GetTempPath()
  [string] $name = [System.Guid]::NewGuid()
  # $name = [System.IO.Path]::GetRandomFileName()
  New-Item -ItemType Directory -Path (Join-Path $parent $name)
}
$global:tmpdir = $(New-TemporaryDirectory)