RESUME-SERVICE | TAKING ON POWERSHELL ONE CMDLET AT A TIME | WEEKLY BLOG

RESUME-SERVICE | TAKING ON POWERSHELL ONE CMDLET AT A TIME | WEEKLY BLOG

This is a part of an on-going blog series written by ME ... Adam Gordon. Each week, I will walk you through a PowerShell command, showing you when and how to use each one. This week, Adam covers Resume-Service.

When to use Resume-Service?

The Resume-Service cmdlet sends a resume message to the Windows Service Controller for each of the specified services. If a service is suspended, it resumes.

If it is currently running, the message is ignored. You can specify the services by their service names or display names, or you can use the -InputObject parameter to pass a service object that represents the services that you want to resume.

What version of PowerShell am I using?

Get the PowerShell Version from your machine:

$PSVersionTable

This command shows you the PowerShell version information on your machine.

No alt text provided for this image

How to use Resume-Service?

Resume a service:

Resume-Service "Waves Audio Services"

This command resumes the Waves Audio Services service (WavesSysSvc64) service on the local computer.

No alt text provided for this image
No alt text provided for this image

Resume all suspended services:

This command resumes all of the suspended services on the computer. The Get-Service cmdlet command gets all of the services on the computer.

The pipeline operator (|) passes the results to the Where-Object cmdlet, which selects the services that have a Status property of Paused.

The next pipeline operator sends the results to Resume-Service, which resumes the paused services.

Get-Service | Where-Object {$_.Status -eq "Paused"} | Resume-Service

No alt text provided for this image






要查看或添加评论,请登录

社区洞察

其他会员也浏览了