PowerShell Flashcards
(6 cards)
What does Get-Service do in PowerShell?
Get-Service lists all services on the system, including their status (Running, Stopped, etc.).
How do you filter services to show only those that are running?
Get-Service | Where-Object {$_.Status -eq “Running”}
filters services with Status equal to Running.
What does $_ represent in PowerShell scripting?
$_ represents the current object in the pipeline, used within script blocks to refer to each item being processed.
How do you stop a service named “Spooler” using PowerShell?
Stop-Service -Name Spooler
How do you list all running processes in PowerShell?
Get-Process
How do you find the service status of the “Spooler” service?
(Get-Service -Name Spooler).Status