diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs
index 6656dcc54..1680e17be 100644
--- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs
+++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs
@@ -266,30 +266,17 @@ namespace Microsoft.PowerShell.Commands
}
///
- /// Retrieve the master list of all processes.
+ /// Gets an array of all processes.
///
- ///
+ /// An array of components that represents all the process resources.
///
/// MSDN does not document the list of exceptions,
/// but it is reasonable to expect that SecurityException is
/// among them. Errors here will terminate the cmdlet.
///
- internal Process[] AllProcesses
- {
- get
- {
- if (_allProcesses == null)
- {
- List processes = new();
- processes.AddRange(Process.GetProcesses());
- _allProcesses = processes.ToArray();
- }
+ internal Process[] AllProcesses => _allProcesses ??= Process.GetProcesses();
- return _allProcesses;
- }
- }
-
- private Process[] _allProcesses = null;
+ private Process[] _allProcesses;
///
/// Add to ,