René's URL Explorer Experiment


Title: Launching `pwsh.exe` without a console (`DETACHED_PROCESS`) results in quiet startup failure · Issue #28383 · PowerShell/PowerShell · GitHub

Open Graph Title: Launching `pwsh.exe` without a console (`DETACHED_PROCESS`) results in quiet startup failure · Issue #28383 · PowerShell/PowerShell

X Title: Launching `pwsh.exe` without a console (`DETACHED_PROCESS`) results in quiet startup failure · Issue #28383 · PowerShell/PowerShell

Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerShell 5.1 and PowerShell. Steps to reprodu...

Open Graph Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...

X Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...

Opengraph URL: https://github.com/PowerShell/PowerShell/issues/28383

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Launching `pwsh.exe` without a console (`DETACHED_PROCESS`) results in quiet startup failure","articleBody":"### Prerequisites\n\n- [x] Write a descriptive title.\n- [x] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\n- [x] Search the existing issues.\n- [x] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\n- [x] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\n\n### Steps to reproduce\n\nLaunching a process with the `DETACHED_PROCESS` flag of the WinAPI `CreateProcess()` function by design does so without a console, even for console-subsystem applications.\n\nHowever, `pwsh.exe` assumes the presence of a console and _quietly aborts_ if it cannot find one: exit code `0` is reported, and no WER (Windows Error Reporting) event is recorded in the Windows Application event log.\n\nNote:\n\n* SCM, the Windows Service Control Manager, is an example of a component that starts (service) executables with `DETACHED_PROCESS`; while using `pwsh.exe` as a service executable is not a common use case, it _is_ possible to implement a service via a `.ps1` script passed to `pwsh.exe -File` - see [this Stack Overflow post](https://stackoverflow.com/a/80012322/45375).\n\n* There are two ways to fix this problem:\n\n  * Report a nonzero exit code and log a WER event with a specific error message - this is what the repro below assumes.\n   \n  * Alternatively, allow PowerShell to run without a console: _infer_ non-interactive mode in the absence of a console and prevent attempts to access console-specific features in a controlled manner (note that the `-noninteractive`  CLI option does _not_ currently do that).\n\n* The following repro code requires .NET 11+ / at least a PowerShell 7.7 preview version, due to use of the new `.StartDetached` property of `ProcessStartInfo`.\n\n```powershell\nusing namespace System.Diagnostics\n\n$startTime = [System.DateTime]::Now\n\n# Start PowerShell without a console (DETACHED_PROCESS)\n# Note: Requires .NET 11+\n[Process]::Start(\n  [ProcessStartInfo] @{\n    FileName = 'pwsh.exe'\n    Arguments = '-c \"Start-Sleep 5\"'\n    StartDetached = $true\n  }\n) | Wait-Process -PassThru | Select-Object *Exit*\n\n\"Ran for $('{0:N1}' -f ([datetime]::Now - $startTime).TotalSeconds) secs.\" | Out-Host\n\n# # As a crosscheck, use the following to provoke a crash that DOES create a WER event.\n# $ps = Start-Process -PassThru conhost.exe (Get-Process -Id $PID).Path; Start-Sleep 2; $ps | Stop-Process\n\n\"Sleeping a little, to give a WER event time to show up\" | Out-Host\n1..5 | ForEach-Object { Write-Host -NoNewline .; Start-Sleep 1 }\nWrite-Host\n\n# Report the resulting WER event, if any.\nGet-WinEvent -FilterHashTable @{\n  ProviderName = 'Windows Error Reporting'\n  Id           = 1001\n  Data = 'pwsh.exe' # matches the \u003cData Name=\"P1\"> sub-element of \u003cEventData>\n  StartTime    = $startTime # events written since this [datetime] instance; supplemnt with `EndTime`, if needed\n} | Format-List\n```\n\nThe offending parts of the source code:\n\n  * https://github.com/PowerShell/PowerShell/blob/2725d6aaa6e67219b6c9902adf7b74c52e0371a3/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs#L548-L571\n  * https://github.com/PowerShell/PowerShell/blob/2725d6aaa6e67219b6c9902adf7b74c52e0371a3/src/Microsoft.PowerShell.ConsoleHost/host/msh/ManagedEntrance.cs#L105-L111\n\n\n\n### Expected behavior\n\n```console\nRan for 10.0 secs.\n.....\nExitCode HasExited ExitTime\n-------- --------- --------\n       1      True \u003ctimestamp>\n\u003ctabular display of a WER event-log entry with a specific error message>\n```\n\n### Actual behavior\n\n```console\nRan for 0.3 secs.\n.....\nExitCode HasExited ExitTime\n-------- --------- --------\n       0      True \u003ctimestamp>\nGet-WinEvent: foo.ps1:25\nLine |\n  25 |  Get-WinEvent -FilterHashTable @{\n     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n     | No events were found that match the specified selection criteria.\n```\n\nThat is:\n* the `Start-Sleep` command passed to `-c` never got to execute\n* the exit code was unexpectedly `0`\n* no WER event was logged.\n\n### Error details\n\n```console\n\n```\n\n### Environment data\n\n```powershell\nPowerShell Core v7.7.0-preview.5 on Windows\n```\n\n### Visuals\n\n_No response_","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2026-11-09T22:28:44Z","url":"https://github.com/PowerShell/PowerShell/issues/28383"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:9db43293-eea6-19c3-7065-39975fb716c8
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA422:11DDE4:34D19D:4891CF:6AFD0F16
html-safe-nonceed44c679449caf2efa28563eeaca7d347a7c1f78fa920a0c393963cc95904a0c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDIyOjExRERFNDozNEQxOUQ6NDg5MUNGOjZBRkQwRjE2IiwidmlzaXRvcl9pZCI6IjY4MDY3MjY4OTUxNzMwMTUyNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac29b344fdb9e0702d338d0f90b7d5a0cfe73d6af7b4015bc5f698bc16f5f7d1a7
hovercard-subject-tagissue:6295994493
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/28383/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b57b6c260c3eb99a5131b89e2615b979c7fffe055dd69dcfb820387deff84414/PowerShell/PowerShell/issues/28383
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b57b6c260c3eb99a5131b89e2615b979c7fffe055dd69dcfb820387deff84414/PowerShell/PowerShell/issues/28383
og:image:altPrerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemklement0
hostnamegithub.com
expected-hostnamegithub.com
Noneb29de2abb97b6307b16270785efeb58b51a117d5a9b659acf00b77aa00e7043b
turbo-cache-controlno-preview
go-importgithub.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id49609581
octolytics-dimension-repository_nwoPowerShell/PowerShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49609581
octolytics-dimension-repository_network_root_nwoPowerShell/PowerShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c9e619def6d670dc18a45d3b02cea938c1c7e47
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/issues/28383#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F28383
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F28383
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=PowerShell%2FPowerShell
Reloadhttps://github.com/PowerShell/PowerShell/issues/28383
Reloadhttps://github.com/PowerShell/PowerShell/issues/28383
Reloadhttps://github.com/PowerShell/PowerShell/issues/28383
PowerShellhttps://github.com/PowerShell
PowerShellhttps://github.com/PowerShell/PowerShell
Codehttps://github.com/PowerShell/PowerShell
Issues1.3k (1.3k)https://github.com/PowerShell/PowerShell/issues
Pull requests364 (364)https://github.com/PowerShell/PowerShell/pulls
Discussionshttps://github.com/PowerShell/PowerShell/discussions
Actionshttps://github.com/PowerShell/PowerShell/actions
Projectshttps://github.com/PowerShell/PowerShell/projects
Security and quality3 (3)https://github.com/PowerShell/PowerShell/security
Insightshttps://github.com/PowerShell/PowerShell/insights
https://github.com/PowerShell/PowerShell
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/28383
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/28383
Launching pwsh.exe without a console (DETACHED_PROCESS) results in quiet startup failurehttps://github.com/PowerShell/PowerShell/issues/28383#top
Needs-TriageThe issue is new and needs to be triaged by a work group.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Needs-Triage%22
WG-Interactive-Consolethe console experiencehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Interactive-Console%22
https://github.com/mklement0
Michael Klement (mklement0)https://github.com/mklement0
on Nov 9, 2026https://github.com/PowerShell/PowerShell/issues/28383#issue-6295994493
latest released versionhttps://github.com/PowerShell/PowerShell/releases
FAQhttps://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md
Differences between Windows PowerShell 5.1 and PowerShellhttps://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell
this Stack Overflow posthttps://stackoverflow.com/a/80012322/45375
PowerShell/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cshttps://github.com/PowerShell/PowerShell/blob/2725d6aaa6e67219b6c9902adf7b74c52e0371a3/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs#L548-L571
2725d6ahttps://github.com/PowerShell/PowerShell/commit/2725d6aaa6e67219b6c9902adf7b74c52e0371a3
PowerShell/src/Microsoft.PowerShell.ConsoleHost/host/msh/ManagedEntrance.cshttps://github.com/PowerShell/PowerShell/blob/2725d6aaa6e67219b6c9902adf7b74c52e0371a3/src/Microsoft.PowerShell.ConsoleHost/host/msh/ManagedEntrance.cs#L105-L111
2725d6ahttps://github.com/PowerShell/PowerShell/commit/2725d6aaa6e67219b6c9902adf7b74c52e0371a3
Michael Klement (mklement0)https://github.com/mklement0
Needs-TriageThe issue is new and needs to be triaged by a work group.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Needs-Triage%22
on Nov 9, 2026https://github.com/PowerShell/PowerShell/issues/28383#event-35621411261
Ryan Yates (kilasuit)https://github.com/kilasuit
WG-Interactive-Consolethe console experiencehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Interactive-Console%22
on Nov 10, 2026https://github.com/PowerShell/PowerShell/issues/28383#event-35639964598
https://github.com/iSazonov
Ilya (iSazonov)https://github.com/iSazonov
on Nov 10, 2026https://github.com/PowerShell/PowerShell/issues/28383#issuecomment-6759153174
https://github.com/jessehouwing
Jesse Houwing (jessehouwing)https://github.com/jessehouwing
on Nov 10, 2026https://github.com/PowerShell/PowerShell/issues/28383#issuecomment-6772197181
https://github.com/mklement0
Michael Klement (mklement0)https://github.com/mklement0
on Nov 10, 2026https://github.com/PowerShell/PowerShell/issues/28383#issuecomment-6775607818
Jesse Houwing (@jessehouwing)https://github.com/jessehouwing
Ilya (@iSazonov)https://github.com/iSazonov
0xFA0https://www.hresult.info/FACILITY_WIN32/0x80070FA0
0x80131623https://www.hresult.info/FACILITY_URT/0x80131623
Sign up for freehttps://github.com/signup?return_to=https://github.com/PowerShell/PowerShell/issues/28383
Sign in to commenthttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/28383
Needs-TriageThe issue is new and needs to be triaged by a work group.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Needs-Triage%22
WG-Interactive-Consolethe console experiencehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Interactive-Console%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.