PowerShell Flashcards

(6 cards)

1
Q

What does Get-Service do in PowerShell?

A

Get-Service lists all services on the system, including their status (Running, Stopped, etc.).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you filter services to show only those that are running?

A

Get-Service | Where-Object {$_.Status -eq “Running”}
filters services with Status equal to Running.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does $_ represent in PowerShell scripting?

A

$_ represents the current object in the pipeline, used within script blocks to refer to each item being processed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you stop a service named “Spooler” using PowerShell?

A

Stop-Service -Name Spooler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you list all running processes in PowerShell?

A

Get-Process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you find the service status of the “Spooler” service?

A

(Get-Service -Name Spooler).Status

How well did you know this?
1
Not at all
2
3
4
5
Perfectly