8000 PS v7.4.1 breaks passing credentials to start-process · Issue #21073 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content
PS v7.4.1 breaks passing credentials to start-process #21073
@RaZz85

Description

@RaZz85

Prerequisites

Steps to reproduce

Since updating to 7.4.1, it is no longer possible to pass credentials through to start-process. Running as admin makes no difference.

$credentials = get-credential
start-process -FilePath "C:\Windows\System32\mstsc.exe" -ArgumentList "/v:myrdpserver" -Credential $credential

Expected behavior

mstsc connects to myrdpserver with the provided credentials

Actual behavior

Start-Process: Access is denied.

Error details

Exception             :
    Type            : System.ComponentModel.Win32Exception
    NativeErrorCode : 5
    ErrorCode       : -2147467259
    TargetSite      :
        Name          : OpenProcess
        DeclaringType : System.Diagnostics.ProcessManager, System.Diagnostics.Process, Version=8.0.0.0, Culture=neutral
, PublicKeyToken=b03f5f7f11d50a3a
        MemberType    : Method
        Module        : System.Diagnostics.Process.dll
    Message         : Access is denied.
    Source          : System.Diagnostics.Process
    HResult         : -2147467259
    StackTrace      :
   at System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32 access, Boolean throwIfExited)
   at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited)
   at System.Diagnostics.Process.GetOrOpenProcessHandle()
   at System.Diagnostics.Process.get_Handle()
   at Microsoft.PowerShell.Commands.StartProcessCommand.BeginProcessing()
   at System.Management.Automation.Cmdlet.DoBeginProcessing()
   at System.Management.Automation.CommandProcessorBase.DoBegin()
CategoryInfo          : NotSpecified: (:) [Start-Process], Win32Exception
FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.PowerShell.Commands.StartProcessCommand
InvocationInfo        :
    MyCommand        : Start-Process
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 5
    Line             : start-process -FilePath  "C:\Windows\System32\mstsc.exe" -ArgumentList "/v:myrdpserver" -Credent
ial $credential
    Statement        : start-process -FilePath  "C:\Windows\System32\mstsc.exe" -ArgumentList "/v:myrdpserver" -Credent
ial $credential
    PositionMessage  : At line:1 char:1
                       + start-process -FilePath  "C:\Windows\System32\mstsc.exe" -ArgumentLis …
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : start-process
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1

Environment data

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

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    7.4-regressionRegression in 7.4In-PRIndicates that a PR is out for the issueResolution-FixedThe issue is fixed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0