Running in Windows 11 Pro 64, I've installed PowerShell 7 and VS Code. I'm able to run PS 7 directly in Windows, which brings up a window titled "PowerShell 7 (x64)". In VS Code, I installed the PowerShell extension. When I run VS Code, I'm able to run Windows PowerShell 5.1, but PS 7 does not appear to be available.
I know VS Code is running PS 5.1 and not 7 because when I call Get-Content ... -AsByteStream
, it does recognize the parameter AsByteStream
.
In VS Code, under "Get Started with PowerShell", there's an item, "Switch Sessions", which says, "To switch between PowerShell 7 and Windows PowerShell 5.1, use the menu: 'Open PowerShell Sessions Menu'" When I click on that button, I get a menu at the top that offers two versions of Windows PowerShell, but no PS 7, as shown in the following display image:
What do I need to do to run PS 7 here?
VSCode Settings JSON:
You need the line marked with HERE comment.