File tree Expand file tree Collapse file tree 1 file changed +4
-17
lines changed
src/Microsoft.PowerShell.Commands.Management/commands/management Expand file tree Collapse file tree 1 file changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -266,30 +266,17 @@ private void RetrieveProcessesByInput()
266
266
}
267
267
268
268
/// <summary>
269
- /// Retrieve the master list of all processes.
269
+ /// Gets an array of all processes.
270
270
/// </summary>
271
- /// <value></value>
271
+ /// <value>An array of <see cref="Process"/> components that represents all the process resources. </value>
272
272
/// <exception cref="System.Security.SecurityException">
273
273
/// MSDN does not document the list of exceptions,
274
274
/// but it is reasonable to expect that SecurityException is
275
275
/// among them. Errors here will terminate the cmdlet.
276
276
/// </exception>
277
- internal Process [ ] AllProcesses
278
- {
279
- get
280
- {
281
- if ( _allProcesses == null )
282
- {
283
- List < Process > processes = new ( ) ;
284
- processes . AddRange ( Process . GetProcesses ( ) ) ;
285
- _allProcesses = processes . ToArray ( ) ;
286
- }
287
-
288
- return _allProcesses ;
289
- }
290
- }
277
+ internal Process [ ] AllProcesses => _allProcesses ??= Process . GetProcesses ( ) ;
291
278
292
- private Process [ ] _allProcesses = null ;
279
+ private Process [ ] _allProcesses ;
293
280
294
281
/// <summary>
295
282
/// Add <paramref name="process"/> to <see cref="_matchingProcesses"/>,
You can’t perform that action at this time.
0 commit comments