Bird
0
0

You want to stop all running instances of 'chrome' safely but only if they use more than 100 MB of memory. Which PowerShell command achieves this?

hard📝 Application Q15 of 15
PowerShell - System Administration
You want to stop all running instances of 'chrome' safely but only if they use more than 100 MB of memory. Which PowerShell command achieves this?
AGet-Process -Name chrome | Where-Object { $_.WorkingSet -gt 100000000 } | Stop-Process
BGet-Process -Name chrome | Where-Object { $_.WorkingSet -gt 100MB } | Stop-Process
CStop-Process -Name chrome -MemoryLimit 100MB
DGet-Process chrome | Stop-Process -MemoryUsage 100MB
Step-by-Step Solution
Solution:
  1. Step 1: Understand memory property and filtering

    The WorkingSet property shows memory usage in bytes. 100 MB equals 100,000,000 bytes approximately.
  2. Step 2: Filter processes by memory and stop them

    Get-Process -Name chrome | Where-Object { $_.WorkingSet -gt 100000000 } | Stop-Process correctly filters chrome processes with memory usage greater than 100,000,000 bytes and pipes them to Stop-Process. Get-Process -Name chrome | Where-Object { $_.WorkingSet -gt 100MB } | Stop-Process uses '100MB' which is invalid syntax. Options C and D use non-existent parameters.
  3. Final Answer:

    Get-Process -Name chrome | Where-Object { $_.WorkingSet -gt 100000000 } | Stop-Process -> Option A
  4. Quick Check:

    Memory in bytes filter with Where-Object = A [OK]
Quick Trick: Memory is in bytes; use numeric value, not '100MB' string [OK]
Common Mistakes:
  • Using '100MB' as a value instead of bytes
  • Trying to use Stop-Process parameters that don't exist
  • Not filtering processes before stopping

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes