PowerShell - Cmdlets and Pipeline
Which of the following is the correct PowerShell pipeline syntax to get services with the status 'Stopped'?
-eq for equality comparison inside script blocks.Where-Object, use $_ to reference the current object and its properties.$_ and -eq. Get-Service | Where-Object { $_.Status = 'Stopped' } uses assignment = instead of comparison. Get-Service | Where-Object Status == 'Stopped' uses invalid syntax without script block. Get-Service | Where-Object { Status -eq 'Stopped' } omits $_ which is required.-eq and $_ inside script block [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions