powershell.exe starts a new console rather than attaching to current when not elevated #21799

Closed
opened 2026-01-31 07:55:12 +00:00 by claunia · 6 comments
Owner

Originally created by @SteveL-MSFT on GitHub (Jun 1, 2024).

Windows Terminal version

1.20.11381.0

Windows build number

10.0.22631.3593

Other Software

No response

Steps to reproduce

In non-elevated cmd.exe within WT, run: powershell.exe

Note: this repros with conhost

Expected Behavior

powershell.exe uses the current console and starts within cmd.exe

Actual Behavior

powershell.exe is spawned in a new window

Note: if cmd.exe is elevated, then powershell.exe DOES start within the same console. This also seems to only repro to domain joined systems and doesn't repro with a clean system in a workgroup so might be related to some GPO?

Originally created by @SteveL-MSFT on GitHub (Jun 1, 2024). ### Windows Terminal version 1.20.11381.0 ### Windows build number 10.0.22631.3593 ### Other Software _No response_ ### Steps to reproduce In non-elevated cmd.exe within WT, run: `powershell.exe` Note: this repros with conhost ### Expected Behavior `powershell.exe` uses the current console and starts within cmd.exe ### Actual Behavior `powershell.exe` is spawned in a new window Note: if `cmd.exe` is elevated, then `powershell.exe` DOES start within the same console. This also seems to only repro to domain joined systems and doesn't repro with a clean system in a workgroup so might be related to some GPO?
claunia added the Needs-TriageIssue-Bug labels 2026-01-31 07:55:12 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jun 1, 2024):

There's definitely something to the idea that it being domain-joined breaks it.

My home laptop:
image

my work VM:
image

Same Windows builds. Different results. Yikes.

@zadjii-msft commented on GitHub (Jun 1, 2024): There's definitely something to the idea that it being domain-joined breaks it. My home laptop: ![image](https://github.com/microsoft/terminal/assets/18356694/e614bddc-ee4f-4d4a-bcde-bad43f2e4c5f) my work VM: ![image](https://github.com/microsoft/terminal/assets/18356694/c20e623b-547e-402a-8967-c2682102ee57) Same Windows builds. Different results. Yikes.
Author
Owner

@yaozhenhua commented on GitHub (Jun 2, 2024):

I noticed this problem too. It breaks our build process since we run powershell scripts in MSBuild. Now before the execution is completed the build has already moved forwarded which ends up an empty file.

@yaozhenhua commented on GitHub (Jun 2, 2024): I noticed this problem too. It breaks our build process since we run powershell scripts in MSBuild. Now before the execution is completed the build has already moved forwarded which ends up an empty file.
Author
Owner

@MichalStrehovsky commented on GitHub (Jun 3, 2024):

This is related to some bad InTune policies that were rolled out Microsoft-wide. Opening Terminal as an administrator works around. Tickets with Microsoft IT have been raised internally.

@MichalStrehovsky commented on GitHub (Jun 3, 2024): This is related to some bad InTune policies that were rolled out Microsoft-wide. Opening Terminal as an administrator works around. Tickets with Microsoft IT have been raised internally.
Author
Owner

@joon612 commented on GitHub (Jun 3, 2024):

This is related to some bad InTune policies that were rolled out Microsoft-wide. Opening Terminal as an administrator works around. Tickets with Microsoft IT have been raised internally.

Same issue here. Could you provide more information about this? Our team and our services have been greatly affected by this issue, thanks!

@joon612 commented on GitHub (Jun 3, 2024): > This is related to some bad InTune policies that were rolled out Microsoft-wide. Opening Terminal as an administrator works around. Tickets with Microsoft IT have been raised internally. Same issue here. Could you provide more information about this? Our team and our services have been greatly affected by this issue, thanks!
Author
Owner

@MichalStrehovsky commented on GitHub (Jun 3, 2024):

This is related to some bad InTune policies that were rolled out Microsoft-wide. Opening Terminal as an administrator works around. Tickets with Microsoft IT have been raised internally.

Same issue here. Could you provide more information about this? Our team and our services have been greatly affected by this issue, thanks!

I don't have more information, sorry. Several of my Redmond-based coworkers were hitting this in the past 24 hours and at least two of them have a case number with MSIT. I can't refer you to the case number since Redmond is sleeping now but the issue started showing up after an Intune policy rollout. I recommend opening a case with MSIT as well.

@MichalStrehovsky commented on GitHub (Jun 3, 2024): > > This is related to some bad InTune policies that were rolled out Microsoft-wide. Opening Terminal as an administrator works around. Tickets with Microsoft IT have been raised internally. > > Same issue here. Could you provide more information about this? Our team and our services have been greatly affected by this issue, thanks! I don't have more information, sorry. Several of my Redmond-based coworkers were hitting this in the past 24 hours and at least two of them have a case number with MSIT. I can't refer you to the case number since Redmond is sleeping now but the issue started showing up after an Intune policy rollout. I recommend opening a case with MSIT as well.
Author
Owner

@SteveL-MSFT commented on GitHub (Jun 3, 2024):

Closing this as it appears to be Microsoft internal policy issue

@SteveL-MSFT commented on GitHub (Jun 3, 2024): Closing this as it appears to be Microsoft internal policy issue
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21799