When I was using PowerShell in the early stages it was limited in some features, now with PowerShell version 5 Microsoft added some great new features to it. This time it’s about creating a tempfile. I already wrote a blog post in 2011 how you can create a tempfile in older version of PowerShell using .NET:
$tempFile = [System.IO.Path]::GetTempFileName()
With PowerShell 5 you got a native cmdlet for this:
$tempFile = New-TemporaryFile
Very cool. I’ve always used the New-GUID cmdlet to come up with my temp file names, but this seems easier!
Yep it is good to have such functions as native PowerShell cmdlets :)