Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't Console in PowerShell ISE use the latest installed version of PowerShell?

I have recently installed PowerShell 6.2.

If I start a PowerShell 6 (x64) command prompt and run $PSVersionTable.PSVersion this is the result

Major  Minor  Patch  PreReleaseLabel BuildLabel
-----  -----  -----  --------------- ----------
6      2      0

From the same prompt I run the ISE using powershell_ise.exe and the PowerShell ISE starts. However, in the console within ISE if I run $PSVersionTable.PSVersion it reports this:

Major  Minor  Build  Revision
-----  -----  -----  --------
4      0      -1     -1  

Is there a setting to control where ISE looks for PowerShell? Or is there any way to ensure it is using the latest version installed?


UPDATE: As part of installing PowerShell Core (i.e. ver 6.2) I had to install Windows Management Framework 5.1. My understanding from this doc is that this should have upgraded the ISE console's version of PowerShell to 5.1 as well. I am still seeing ver 4.0 as noted above. What am I missing?

like image 792
Trevor Reid Avatar asked Apr 17 '19 16:04

Trevor Reid


1 Answers

The latest version of PowerShell is 5.1, this is the most recent version that you can use in ISE as well.

PowerShell 6 is also known as PowerShell Core, which is not supported in ISE. You can download a tool called Visual Studio Code that can be used with PowerShell 6 (Core).

Bonus: Interestingly enough, there was actually an article I read recently about a PowerShell 7 that Microsoft is currently working on which looks pretty interesting. See here as well for PowerShell 7.

Update: Thanks @Magnetron for updating in the comments. PowerShell 7 officially released this week.

Hope this helps!

like image 127
cet51 Avatar answered Oct 03 '22 15:10

cet51