Title: New-TemporaryDirectory or New-TemporaryItem or New-Item -Temporary · Issue #25754 · PowerShell/PowerShell · GitHub
Open Graph Title: New-TemporaryDirectory or New-TemporaryItem or New-Item -Temporary · Issue #25754 · PowerShell/PowerShell
X Title: New-TemporaryDirectory or New-TemporaryItem or New-Item -Temporary · Issue #25754 · PowerShell/PowerShell
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) ...
Open Graph 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 t...
X 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 t...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/25754
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"New-TemporaryDirectory or New-TemporaryItem or New-Item -Temporary","articleBody":"### Summary of the new feature / enhancement\n\nCurrently, there is only one option for creating temporary items without relying on `[System.IO]` calls and that is `New-TemporaryFile`.\n\nSince 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:\n\n```pwsh\nNew-TemporaryFile | % { rm $_; ni $_ -ItemType Directory }\n```\n\nWhich seems counter-intuitive\n\n### Proposed technical implementation details (optional)\n\nAs [proposed previously](https://github.com/PowerShell/PowerShell/issues/3442), a few potential solutions exist:\n- Create a new cmdlet/function called `New-TemporaryDirectory` that functions identically to `New-TemporaryFile`, but for dirs.\n- Rename `New-TemporaryFile` to `New-TemporaryItem` and add support for `-ItemType Directory`\n- Add a `-Temporary` switch to `New-Item`\n\nThis previous issue was closed, because it offloaded support for temporary paths to dotnet and `[System.IO]`.\n\nWhile using `[System.IO]` works in Full Language Mode (FLM), it does not for CLM, RLM, and NLM (No Language Mode)","author":{"url":"https://github.com/anonhostpi","@type":"Person","name":"anonhostpi"},"datePublished":"2025-07-14T13:12:50Z","url":"https://github.com/PowerShell/PowerShell/issues/25754"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:57a3c11c-7f54-35a0-a2fa-d1cb11afa0f3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 966E:DE300:10A65E:166C0C:6AFD2D52 |
| html-safe-nonce | d691cd7383591fd16cbbe576c5b97b9d987aed50969395a4db9f8d539e3d93bc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjZFOkRFMzAwOjEwQTY1RToxNjZDMEM6NkFGRDJENTIiLCJ2aXNpdG9yX2lkIjoiMzg4OTMzMTY0NTU1NDk2MTc0NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | eb21caa428e5606a50034aee6c020a9ca962b70e44d9ade5eabb66c19709ac54 |
| hovercard-subject-tag | issue:3228737231 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/25754/issue_layout |
| twitter:image | https://opengraph.githubassets.com/776424421f76a0211be185b052737a0ad9279b5b8fe8030f14cf684ca6d4ae6d/PowerShell/PowerShell/issues/25754 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/776424421f76a0211be185b052737a0ad9279b5b8fe8030f14cf684ca6d4ae6d/PowerShell/PowerShell/issues/25754 |
| og:image:alt | 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 t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | anonhostpi |
| hostname | github.com |
| expected-hostname | github.com |
| None | 065128366c233a9d57ff68ab6c96e25b99dd1b0ab70d23b70873d3dd6b5e4f19 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 941021edf0c2ec58298f4a2c8f27ae507d129c92 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width