Sometimes you need to save some data in to a tempfile. And instead of creating a ownen file for this you could use the .NET function to create a really tempfile in the tempfile directory.
This is the how you can create a new tempfile:
$tempFile = [System.IO.Path]::GetTempFileName()
And now you can parse data into this file.
Tags: .NET, Create tempfile, Microsoft, PowerShell, System.IO.path, Tempfile, Windows, Windows Powershell Last modified: April 20, 2011
It requires to run as Admin, otherwise it returns empty string