mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Use Environment.ProcessId in SpecialVariables.PID (#24926)
This commit is contained in:
@@ -337,10 +337,9 @@ namespace System.Management.Automation
|
||||
this.GlobalScope.SetVariable(v.Name, v, asValue: false, force: true, this, CommandOrigin.Internal, fastPath: true);
|
||||
|
||||
// $PID
|
||||
Process currentProcess = Process.GetCurrentProcess();
|
||||
v = new PSVariable(
|
||||
SpecialVariables.PID,
|
||||
currentProcess.Id,
|
||||
Environment.ProcessId,
|
||||
ScopedItemOptions.Constant | ScopedItemOptions.AllScope,
|
||||
RunspaceInit.PIDDescription);
|
||||
this.GlobalScope.SetVariable(v.Name, v, asValue: false, force: true, this, CommandOrigin.Internal, fastPath: true);
|
||||
|
||||
Reference in New Issue
Block a user