mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +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:
1 parent
ef2ba40ca7
commit
09f20879b8
1 file changed
+7
-2
@@ -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