≡ Menu

How to create temp files using powershell script.

I just came across a interesting tip that might help in your powershell scripting. It is about creating the temp file. In your script, if you want to create some temp file for processing and then it is right choice. The advantage with this approach is, it directly creates a file in %temp% of user profile and returns the path. Another good thing is, if you run it multiple times, it returns a new temp file each time.

[System.IO.Path]::GetTempFileName()

 

Hope this tiny one helps…

Comments on this entry are closed.