PowerShell 5 introduces the New-TemporaryFile cmdlet, which is handy. How can I do the same thing but instead of a file create a directory? Is there a New-TemporaryDirec
New-TemporaryDirec
I love one liners if possible. @alroc .NET also has [System.Guid]::NewGuid()
[System.Guid]::NewGuid()
$temp = [System.Guid]::NewGuid();new-item -type directory -Path d:\$temp Directory: D:\ Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 1/2/2016 11:47 AM 9f4ef43a-a72a-4d54-9ba4-87a926906948