You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 }
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)