Skip to content

Agent Hooks dont work when Windows Powershell is restricted on workstation #312314

Open

Description

@charlesip-collab

vscode/extensions/copilot/src/platform/chat/node/hookExecutor.ts at main · microsoft/vscode

Current hook execution forces the usage of Windows Powershell when I have Powershell 7+ installed and configured as default in VSCode for integrated terminal, terminal.integrated.automationProfile.window and chat.tools.terminal.terminalProfile.windows

In a lot of corporate environments, Windows powershell usage is restricted to administrators, and in this scenario, Hooks does not work at all. Instead of hardcoding, this should honour what is set in settings.json.

  • Copilot Chat Extension Version:
  • VS Code Version: 1.117.0 (user Setup)
  • OS Version: Windwos_NT x64 10.0.022631
  • Feature Agent hooks
  • Selected model : Any model

Steps to Reproduce:

  1. restrict usage of Windows powershell to user
  2. trigger hooks,

2026-04-13 17:48:46.847 [info] [HookExecutor] Hook command failed to start: cmd.exe /c echo 'Test hook fired!': spawn EPERM
2026-04-13 17:48:46.847 [info] [#0] [SessionStart] Completed (NonBlockingError) in 7ms
2026-04-13 17:48:46.847 [info] [#0] [SessionStart] Output: spawn EPERM

Activity

  1. added
    chat-ext-issue
    on Apr 24, 2026
  2. removed
    chat-ext-issue
    on Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions