Skip to content

Get path to a temporary directory #3442

Closed

Description

@iSazonov

Now, New-TemporaryFile cmdlet creates path to a temporary file. Sometimes we want to have path to a temporary directory.

Proposal is to add a Directory switch to get path to new temporary directory.

Activity

  1. added
    Issue-Enhancement
    on Mar 28, 2017
  2. wisemoth commented on Mar 28, 2017

    @wisemoth

    I've also needed this.

    I think the name would become (eg) New-TemporaryItem. Or perhaps add a -Temporary switch to the existing New-Item and let the provider figure out what that means.

  3. added this to the milestone on Jul 24, 2017
  4. Liturgist commented on Jul 27, 2017

    @Liturgist

    I can agree that New-Item -Temporary would work, it is not quite as obvious as New-TemporaryFile, New-TemporaryDirectory, or even New-TemporaryItem.

    Adding this to New-Item should allow for temporary files and directories to be created on a -Path other than the platform "temp" directory. If -Path is not specified, the provider should know the platform "temp" directory.

  5. bergmeister commented on Mar 7, 2018

    @bergmeister
    Contributor

    Ilya (@iSazonov) Should we mark this as blocked due to https://github.com/dotnet/corefx/issues/24001 as welll?

  6. added
    Waiting - DotNetCore
    on Mar 12, 2018
  7. bergmeister commented on Jan 23, 2020

    @bergmeister
    Contributor

    The .Net team has now created a new tracking issue as they are now committed to implementing various improvements to the temp file APIs that will cover this. We can expect this to be available in .net 5
    dotnet/runtime#2048

  8. anonhostpi commented on Jul 14, 2025

    @anonhostpi

    Offloading this to dotnet does not resolve the problem for Constrained Language Mode or Restricted Language Mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-EnhancementWG-CmdletsWaiting - DotNetCore

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions