Creating temporary file in PowerShell is pretty simple – because you can use .NET call directly it’s a matter of:
[IO.Path]::GetTempFileName()
The problem you may walk into is the rare case when your file has to have specific extension to work properly. I usually have this issue when I try to use temporary file to create formatting/ type information at runtime. Read more…