1

I have installed PowerShell using the scoop package manager on my system. However, even after installation, the system still refers to the old path of PowerShell.

I have tried adding the new path of the new PowerShell installation to the environment variables, but it doesn't seem to make any difference.

Here is the output of the where.exe command for PowerShell:

where.exe Powershell
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
where.exe pwsh
E:\Apps\scoop\apps\powershell\current\pwsh.exe
E:\Apps\scoop\shims\pwsh.exe

Due to this behavior, I am unable to use the newly installed PowerShell through Scoop in my Windows Terminal and VS Code.

enter image description here

enter image description here

How can I change this behavior where the system continues to refer to the old path of PowerShell despite installing it with Scoop? I need to ensure that the new PowerShell installation is recognized and used by my Windows Terminal and VS Code.

Flamingo
  • 322
  • 1
  • 11
  • 3
    I'm not sure if I understand your issue. PowerShell version 6.x and up are **not** a replacement of the Windows PowerShell. They exist next to each other and can both be used. The newer versions are refered to as `PowerShell` while the legacy version is called `Windows PowerShell`. – Olaf Jun 18 '23 at 08:49
  • @Olaf I'm feeling confused as I had thought that PowerShell Core 7 was a replacement for Windows PowerShell. However, after doing some research, I discovered that it is indeed the same as you mentioned. – Flamingo Jun 18 '23 at 09:10

1 Answers1

2
  • For vscode profile i open setting.json and add:
     "terminal.integrated.profiles.windows": {
    "PowerShell Core": {
      "path": "pwsh.exe",
      "icon": "terminal-powershell"
    },
  },
  "terminal.integrated.defaultProfile.windows": "PowerShell Core"
  • For Windows Terminal, I simply create a new profile and modified the path to the pwsh executable.

To find the exact path of pwsh.exe, I typed where.exe pwsh in the terminal.

Flamingo
  • 322
  • 1
  • 11