Skip to content

Add ability to create a temporary file with a specific extension to New-TemporaryFile #4215

@mklement0

Description

@mklement0

Related: #3442

Currently, New-TemporaryFile invariably creates temp. files with extension .tmp.

Sometimes, however, it is helpful to create temp. files with a specific filename extension.

Adding an -Extension parameter could provide that:

Desired behavior

> New-TemporaryFile -Extension .ps1

    Directory: C:\Users\jdoe\AppData\Local\Temp

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        7/10/2017   9:53 PM              0 tmpE3B8.ps1

Environment data

PowerShell Core v6.0.0-beta.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifIssue-Enhancementthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility moduleWaiting - DotNetCorewaiting on a fix/change in .NET

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions