The PowerShell ISE built into Windows works with Windows PowerShell only and is stuck at PowerShell version 5.1. Typically, when you want to use an editor to write PowerShell 7 code, Visual Studio Code and the PowerShell extension is the way to go.
Still, you can make PowerShell ISE “talk” to PowerShell 7. It then provides rich IntelliSense for PowerShell 7 and understands all language features that were introduced in PowerShell 7.
For this, you start a local remoting session from within the PowerShell ISE, and specify the configuration name “powershell.7”.
PS> Enter-PSSession -ComputerName localhost -ConfigurationName powershell.7
This of course requires a number of prerequisites:
Now you should be all set, and when you run Enter-PSSession with the parameters above, you remote into PowerShell 7.
If your current user is no Administrator, or you logged on with your email address and a Microsoft account, you need to create a local user account with Administrator privileges and use it explicitly for authentication:
PS> Enter-PSSession -ComputerName localhost -ConfigurationName powershell.7 -Credential localAdminUser
ReTweet this Tip!
Here is another way to do this, that has been around for a while now from the creator/author of the PowerShell Pro Tools marketplace addon on for PowerShell/VSCode/Visual Studio. He provides all the code and even provides code to make it a menu option in the ISE to switch into and out of Windows Powershell and PowerShell Core with a click hotkey combination
Using PowerShell 7 in the Windows PowerShell ISEironmansoftware.com/using-powershell-core-6-and-7-in-the-windows-powershell-ise
Powered by IDERA