-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New-TemporaryDirectory or New-TemporaryItem or New-Item -Temporary #25754
Copy link
Copy link
Open
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreUp-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
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 bugResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreUp-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
Fields
Give feedbackNo fields configured for issues without a type.
Projects
StatusShow more project fields
Reviewed
Summary of the new feature / enhancement
Currently, there is only one option for creating temporary items without relying on
[System.IO]calls and that isNew-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:Which seems counter-intuitive
Proposed technical implementation details (optional)
As proposed previously, a few potential solutions exist:
New-TemporaryDirectorythat functions identically toNew-TemporaryFile, but for dirs.New-TemporaryFiletoNew-TemporaryItemand add support for-ItemType Directory-Temporaryswitch toNew-ItemThis 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)