Create temporary files in PowerShell

Often temporary files are required as part of a PowerShell script, to store temporary results etc.
The New-TemporaryFile command makes it easy, returning a System.IO.FileInfo object that represents a temporary file created in the TEMP directory of the user running the command.

 $TemporaryFile = New-TemporaryFile



https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-temporaryfile

Comments

Popular posts from this blog

Decoding OCSP GET requests

Signing a CSR with an Enrollment Agent certificate

Compacting an AD CS database