PowerShell 7.7.0 Preview 4 Adds New-TemporaryDirectory and Hardens Windows Security
PowerShell 7.7.0 preview 4 landed on GitHub today and it finally gives you a native way to create temporary directories without wrestling with .NET calls. The fourth preview in the v7.7 cycle is built on .NET 11.0 SDK preview.6, marking a full platform jump from the stable 7.6.x line that still rides on .NET 10.
The v7.7 branch has been a slow burn since preview 1 dropped in late April. You've seen UUID v7 defaults in preview 3, progress bar render fixes, and a steady stream of engine polish. This latest drop focuses on stabilization, which is exactly what a preview cycle needs before the final release.
A long-awaited directory cmdlet
The headline addition is New-TemporaryDirectory. Kirtikumar Anandrao Ramchandani authored it, and it follows the exact shape of New-TemporaryFile. You get a uniquely named folder under your system temp path, plus a -Prefix parameter if you need to namespace your scratch directories. The real win here is how it behaves in constrained language modes. When restricted language blocks direct [System.IO] calls, this cmdlet still works. The Working Group explicitly asked for it, and the implementation rejects unsafe prefix characters to keep path injection at bay.
WLDP lockdown gets serious on Windows
Patrick Meinecke added a Windows-only security gate that aligns PowerShell with the Lockdown Policy registry key EnableFileOnlyEntry. Enable it, and pwsh.exe refuses to run unless you explicitly pass -File script.ps1. No bare invocation. No -Command. No interactive sessions. It even blocks remoting endpoints when the policy is enforced. Legitimate script execution stays untouched, and you can still pull up help or version flags without tripping the gate. The team actually backported this to 7.4, 7.5, and 7.6, which tells you exactly how much they consider it a security priority.
The rest of the preview rounds out the engine with fixes for dot-sourcing behavior, PATH caching in command discovery, and remoting frame header validation. You'll also notice Ubuntu 26.04 joined the supported distribution list, while end-of-life Debian 12 got dropped from the packaging pipeline. The Microsoft.PowerShell.Archive module bumped to 1.2.6, and min-size arm64 packages got their own dedicated build path. It's a solid polish pass.
Community reaction on the release page is pretty quiet so far, with only five reactions logged. That makes sense. Preview 4 ships less than a day before this reporting, so adoption hasn't had time to catch up. The project itself sits at 55.2k stars and 8.4k forks, which shows the baseline engagement is still healthy. I'd say the preview is shaping up to be the most practically useful major version in a while. Temporary directory creation has been a recurring pain point for automation scripts, and the lockdown policy alignment gives enterprises exactly the guardrails they've been asking for.
Head here to download the release from the GitHub release page. SHA256 manifests are included for verification. The final v7.7.0 release is still months away, but the direction is clear.
