Title: Start-Process -Wait doesn't work when running as a different user (-Credential) · Issue #17033 · PowerShell/PowerShell · GitHub
Open Graph Title: Start-Process -Wait doesn't work when running as a different user (-Credential) · Issue #17033 · PowerShell/PowerShell
X Title: Start-Process -Wait doesn't work when running as a different user (-Credential) · Issue #17033 · 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/17033
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Start-Process -Wait doesn't work when running as a different user (-Credential)","articleBody":"### Prerequisites\r\n\r\n- [X] Write a descriptive title.\r\n- [X] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\r\n- [X] Search the existing issues.\r\n- [X] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\r\n- [X] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://docs.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\r\n\r\n### Steps to reproduce\r\n\r\nOn Windows, when you combine `Start-Process -Wait` with `-Credential` (running as a different user), the process is launched, BUT\r\n* an `Access denied` error is reported\r\n* no waiting occurs.\r\n\r\nBy contrast, using `-PassThru` and `.WaitForExit()` on the passed through `System.Diagnostics.Process` instance works fine.\r\n\r\n```powershell\r\n# Run on Windows\r\n# Be sure to specify valid credentials when prompted.\r\nStart-Process -Credential (Get-Credential) cmd -Wait\r\n```\r\n\r\n### Expected behavior\r\n\r\nNo error should occur, and the call should block until the launched `cmd` instance is exited.\r\n\r\n\r\n### Actual behavior\r\n\r\nThe `cmd` instance is launched, but, instead of waiting, an `Access denied` error is emitted.\r\n\r\nContrast this with this seemingly equivalent command, which works as expected:\r\n\r\n```powershell\r\n(Start-Process -Credential (Get-Credential) cmd -PassThru).WaitForExit()\r\n```\r\n\r\n### Error details\r\n\r\n_No response_\r\n\r\n### Environment data\r\n\r\n```powershell\r\nPowerShell Core 7.3.0-preview.2 on Windows\r\n```\r\n\r\n\r\n### Visuals\r\n\r\n_No response_","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2022-03-19T22:08:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/17033/PowerShell/issues/17033"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ca4a4f28-2cb1-9965-cc39-d3db0ab6030e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DB56:17598F:39066F4:4EE71F0:6A54BF37 |
| html-safe-nonce | fb555f232a7ee3201aae2ab3d79628ff54cdbb71104983bd5ed2cc586549c2f2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjU2OjE3NTk4RjozOTA2NkY0OjRFRTcxRjA6NkE1NEJGMzciLCJ2aXNpdG9yX2lkIjoiODU1NjYyNjg2OTAwMDM4ODQwNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 41651ee1f18969b3b757aaabd932b1a34a118a81e554ce25f4f61a3ed7460509 |
| hovercard-subject-tag | issue:1174382585 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/17033/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f7997c5e4933f4a40ec1cd92aab25b5af59943d3db0d191eeb7ba989425c4db9/PowerShell/PowerShell/issues/17033 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f7997c5e4933f4a40ec1cd92aab25b5af59943d3db0d191eeb7ba989425c4db9/PowerShell/PowerShell/issues/17033 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mklement0 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 69f9664dd5e7a82ba8ab1b4cb7f5a2f09333ab38 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width