-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issues
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 reproduce
On Windows, when you combine Start-Process -Wait with -Credential (running as a different user), the process is launched, BUT
- an
Access deniederror is reported - no waiting occurs.
By contrast, using -PassThru and .WaitForExit() on the passed through System.Diagnostics.Process instance works fine.
# Run on Windows
# Be sure to specify valid credentials when prompted.
Start-Process -Credential (Get-Credential) cmd -WaitExpected behavior
No error should occur, and the call should block until the launched cmd instance is exited.
Actual behavior
The cmd instance is launched, but, instead of waiting, an Access denied error is emitted.
Contrast this with this seemingly equivalent command, which works as expected:
(Start-Process -Credential (Get-Credential) cmd -PassThru).WaitForExit()Error details
No response
Environment data
PowerShell Core 7.3.0-preview.2 on WindowsVisuals
No response
Metadata
Metadata
Assignees
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issues