PowerTip: Use PowerShell to Create Temporary File Name

Doctor Scripto

Summary: Use Windows PowerShell to create a temporary file name.

Hey, Scripting Guy! Question I need to output data to a file, but I do not need a permanent file name and location because
           the file will be later deleted. How can I easily use Windows PowerShell to create a temporary file name?

Hey, Scripting Guy! Answer Use the GetTempFileName static method from the System.IO.Path .NET Framework class:

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

0 comments

Discussion is closed.

Feedback usabilla icon