[Windows] Agent keep using PowerShell 5 instead of PowerShell 7

Where does the bug appear (feature/product)?

Cursor IDE

(only IDE, Cursor CLI is not affected)

Describe the Bug

I have PowerShell 7 terminal configured as a default everywhere: Cursor settings (default profile, automation profile, integrated terminal), it’s on the top of my env PATH, it’s the default Windows terminal profile, etc. Literally nowhere I have PowerShell 5 selected.

And despite of all that, Cursor Agents refuse to use PS7 and somehow keep using PS5. As a result, most shell commands executed by Agents fail as most models use new PS7 syntax (i.e. && over ;).

Steps to Reproduce

Ask the Agent: “Run $PSVersionTable.PSVersion”

Operating System

Windows 10/11

Version Information

Version: 3.7.19 (system setup)
VS Code Extension API: 1.105.1
Commit: 80c653c2c3528e65016a0d304b54486084b470b0
Date: 2026-06-07T01:42:56.126Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
xterm.js: 6.1.0-beta.256
OS: Windows_NT x64 10.0.26200

For AI issues: which model did you use?

Composer 2.5

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor


Screenshot

Hey, thanks for the detailed report and the screenshot. It’s clear: the integrated terminal is on PS7, but the agent shell resolves to PS5.1.

This is a known bug on our side. On Windows, the agent shell executor can resolve PowerShell independently of terminal.integrated.defaultProfile.windows, and it can fall back to the built-in Windows PowerShell 5.1. We’re tracking the issue, but I can’t share an exact ETA for a fix yet.

One thing that might help as a workaround: in your settings.json, the path to pwsh goes through ...\AppData\Local\Microsoft\WindowsApps\pwsh.exe. That’s a Store alias, and it doesn’t always resolve correctly during PATH lookup. Try installing PowerShell 7 via the regular MSI installer from Releases · PowerShell/PowerShell · GitHub. Then pwsh.exe will be in C:\Program Files\PowerShell\7\ and will be added to the system PATH properly. After installing, fully restart Cursor and check again with $PSVersionTable.PSVersion.

Let me know if it helps. If PS5 still shows up even after the system install, reply back and I’ll add that info to the report.

  1. winget uninstall PowerShell
  2. Install PowerShell 7 .msi from GitHub
  3. Add it to the top of PATH and set as default terminal

The issue is fixed now.