vscode-powershell icon indicating copy to clipboard operation
vscode-powershell copied to clipboard

Microsoft Endpoint Privilege Management - CLI Integration with Virtual Accounts

Open MatthewBlytheM opened this issue 1 month ago • 2 comments

Prerequisites

  • [x] I have written a descriptive issue title.
  • [x] I have searched all open and closed issues to ensure it has not already been reported.
  • [x] I have read the troubleshooting guide.
  • [x] I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • [x] I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • [x] If this is a security issue, I have read the security issue reporting guidance.

Summary

When we deploy Microsoft Endpoint Privilege Management with rules that allow for end users to elevate CLI (Powershell, Command, Terminal...) VS Code does not dock and link the interfaces to the VS Code instance. Instead a new window of the CLI opens and does not link to VS Code so code can not be ran/debugged/executed from inside of VS Code.

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.5.3
PSEdition                      Core
GitCommitId                    7.5.3
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Name             : ConsoleHost
Version          : 7.5.3
InstanceId       : cba9322f-cf07-4dcf-9645-9e1407bc14a8
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Visual Studio Code Version

1.105.1
x64

Extension Version

[email protected]

Steps to Reproduce

  1. Have a deployed policy that allows EMP to run a CLI as elevated
  2. Open VS Code

Visuals

After Opening and running a simple command Image

Logs

2025-10-21 10:13:04.019 [info] Visual Studio Code: v1.105.1 64-bit on Windows 64-bit 2025-10-21 10:13:04.019 [info] PowerShell Extension: v2025.4.0 2025-10-21 10:13:04.142 [info] Starting 'PowerShell (x64)' at: C:\Program Files\PowerShell\7\pwsh.exe 2025-10-21 10:13:04.744 [info] PowerShell process started with PID: 34660 2025-10-21 10:13:05.069 [warning] PowerShell process terminated or Extension Terminal was closed, PID: 34660 2025-10-21 10:13:05.237 [error] Extension Terminal is undefined. 2025-10-21 10:13:05.326 [error] PowerShell Language Server process didn't start! 2025-10-21 10:13:38.961 [info] Starting 'PowerShell (x64)' at: C:\Program Files\PowerShell\7\pwsh.exe 2025-10-21 10:13:39.159 [info] PowerShell process started with PID: 34632 2025-10-21 10:13:39.486 [warning] PowerShell process terminated or Extension Terminal was closed, PID: 34632 2025-10-21 10:13:39.631 [error] Extension Terminal is undefined. 2025-10-21 10:13:39.702 [error] PowerShell Language Server process didn't start! 2025-10-21 10:13:39.702 [error] PowerShell session unavailable for debugging!

Logs did not generate here: %APPDATA%\Code\User\globalStorage\ms-vscode.powershell\logs with the races from instructions here: https://github.com/PowerShell/vscode-powershell/blob/main/docs/troubleshooting.md#logs -- It looks like the disconnected CLI is preventing the traces from being generated. This also seemed to affected the Language Server Protocol payload logs as well.

MatthewBlytheM avatar Oct 21 '25 14:10 MatthewBlytheM