Complete the code to list all running processes.
Get-Process | Where-Object { $_.CPU -gt [1] }The code filters processes with CPU greater than 0. Since CPU time is always ≥ 0, this lists all running processes except those with exactly 0 CPU time.
Complete the code to stop a service named 'Spooler'.
Stop-Service -Name [1]'Spooler' is the correct service name to stop the print spooler service.
Complete the code to get the current date and time.
$now = Get-Date[1]Empty parentheses explicitly invoke the Get-Date cmdlet.
Fill both blanks to filter services that are running and display their names.
Get-Service | Where-Object { $_.Status -eq [1] } | Select-Object [2]Filtering services with status 'Running' and selecting their 'Name' shows active service names.
Fill both blanks to create a hashtable of process names and their IDs for processes using more than 50 CPU seconds.
$processes = @{}; Get-Process | Where-Object { $_.CPU -gt 50 } | ForEach-Object { $processes[[1]] = [2] }The hashtable maps each process name to its ID for processes with CPU time over 50 seconds.