-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Open
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issuesWG-ReviewedA Working Group has reviewed this and made a recommendationA Working Group has reviewed this and made a recommendation
Description
Summary of the new feature / enhancement
Currently, there is only one option for creating temporary items without relying on [System.IO] calls and that is New-TemporaryFile.
Since users subjected to Constrained (CLM) or Restricted (RLM) Language Modes can not use [System.IO], if they want to create a directory, they must use:
New-TemporaryFile | % { rm $_; ni $_ -ItemType Directory }Which seems counter-intuitive
Proposed technical implementation details (optional)
As proposed previously, a few potential solutions exist:
- Create a new cmdlet/function called
New-TemporaryDirectorythat functions identically toNew-TemporaryFile, but for dirs. - Rename
New-TemporaryFiletoNew-TemporaryItemand add support for-ItemType Directory - Add a
-Temporaryswitch toNew-Item
This previous issue was closed, because it offloaded support for temporary paths to dotnet and [System.IO].
While using [System.IO] works in Full Language Mode (FLM), it does not for CLM, RLM, and NLM (No Language Mode)
mklement0 and cglong
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issuesWG-ReviewedA Working Group has reviewed this and made a recommendationA Working Group has reviewed this and made a recommendation
Type
Projects
Status
Reviewed