mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Guard use of UseShellExecute in PackageManagement
To re-enable elevation, the process will need to fork. For now, don't fail fatally.
This commit is contained in:
committed by
Andrew Schwartzmeyer
parent
ef2ba40ca7
commit
09f20879b8
@@ -190,9 +190,14 @@ namespace Microsoft.PackageManagement.Internal.Implementation {
|
||||
public int StartProcess(string filename, string arguments, bool requiresElevation, out string standardOutput, IRequest requestObject) {
|
||||
Process p = new Process();
|
||||
|
||||
if (requiresElevation) {
|
||||
#if !CORECLR
|
||||
if (requiresElevation)
|
||||
{
|
||||
p.StartInfo.UseShellExecute = true;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
p.StartInfo.UseShellExecute = false;
|
||||
p.StartInfo.RedirectStandardOutput = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user