PowerShell ISE: how to run new PowerShell version

陌路散爱 提交于 2019-12-05 02:01:26
postanote

PowerShell has 3 executables...

Windows only...

  • PowerShell_ISE.exe = ISE v2 - v5.1
  • powershell.exe = consolehost v1 - 5.1

Note: (there are no new versions coming, but this will be supported going forward as it is today, as per Microsoft announcements, just nothing new coming to it. Just bug /security fixes.)

Cross-platform

  • pwsh.exe = PowerShell Core/v6

The editor to use if you are using v6 is Visual Studio Code, which is also cross-platform, unlike the ISE.

https://code.visualstudio.com/Download

The are no plans to make the ISE leverage pwsh.exe/PSCore.

However, you can continue to use the ISE, and if you need something specifically to leverage PSCore, you have to shell out to it just as you would to cmd.exe. Your code will run the pwsh.exe console, and return you back to the ISE, depending on how you shell out to it.

What you are using is Windows PowerShell ISE which is always has Windows PowerShell as the integrated shell, you need VSCode here, where you can select which version of PowerShell to use ...

Just need to change below item in File -> Preferences -> Settings.

"terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\pwsh.exe"

Same can be done via UI in few clicks as well...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!