Running PowerShell 7 and 5.1 in the same window
Ask an admin which PowerShell they use and the answer is usually both. PowerShell 7 for new work. Windows PowerShell 5.1 for the module that never got ported, the vendor snap-in, the 2016 script that works and is not to be touched. This stopped being a transition years ago. It’s just how Windows environments are.
Most editors give you one integrated shell and let you sort out the rest in separate windows. DetentShell treats both engines as first-class sessions in one window. File, New PowerShell Session opens a PowerShell 7 tab. File, New Windows PowerShell 5.1 Session opens exactly that: a persistent out-of-process Windows PowerShell with streaming output and durable state. Set a variable there, come back ten minutes later, it’s still set. The tab title carries “(Windows PowerShell 5.1)” so you always know which world you’re typing into. On a machine without 5.1 installed, the menu item is disabled instead of failing later.
Each session owns its own runspace, console, and script tabs, so the two worlds can’t contaminate each other. Having them side by side turns out to be a working tool in itself. When a script behaves differently across engines, you stop guessing: run it in the left tab, run it in the right tab, read the difference.
The integration respects where 5.1 differs. The engine picker on the toolbar is disabled inside a 5.1 session because every run there is 5.1, so there’s nothing to pick. Start-Job works natively in 5.1 sessions, while the hosted PS7 engine points you at Start-ThreadJob instead of half-working. The color machinery knows 5.1 has no $PSStyle and leaves that session alone. A crashed 5.1 child process gets reported in plain English, and the next run tells you again until you open a fresh session, rather than pretending the old one is fine.
If you want the actual console programs instead of hosted sessions, the File menu launches those too. Start PowerShell 7 and Start Windows PowerShell 5.1 open the external consoles, with an honest error when the runtime isn’t installed.