Compartir a través de


Resume-Service

Resumes one or more suspended (paused) services.

Sintaxis

InputObject (Es el valor predeterminado).

Resume-Service
    [-InputObject] <ServiceController[]>
    [-PassThru]
    [-Include <String[]>]
    [-Exclude <String[]>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Default

Resume-Service
    [-Name] <String[]>
    [-PassThru]
    [-Include <String[]>]
    [-Exclude <String[]>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

DisplayName

Resume-Service
    -DisplayName <String[]>
    [-PassThru]
    [-Include <String[]>]
    [-Exclude <String[]>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

This cmdlet is only available on the Windows platform.

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.

Ejemplos

Example 1: Resume a service on the local computer

PS C:\> Resume-Service "sens"

This command resumes the System Event Notification service on the local computer. The service name is represented in the command by sens. The command uses the Name parameter to specify the service name of the service, but the command omits the parameter name because the parameter name is optional.

Example 2: Resume all suspended services

PS C:\> Get-Service | Where-Object {$_.Status -eq "Paused"} | Resume-Service

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.

In practice, you would use the WhatIf parameter to determine the effect of the command before you run it.

Parámetros

-Confirm

Prompts you for confirmation before running the cmdlet.

Propiedades del parámetro

Tipo:SwitchParameter
Valor predeterminado:False
Admite caracteres comodín:False
DontShow:False
Alias:cf

Conjuntos de parámetros

(All)
Posición:Named
Mandatory:False
Valor de la canalización:False
Valor de la canalización por nombre de propiedad:False
Valor de los argumentos restantes:False

-DisplayName

Specifies the display names of the services to be resumed. Wildcard characters are permitted.

Propiedades del parámetro

Tipo:

String[]

Valor predeterminado:None
Admite caracteres comodín:True
DontShow:False

Conjuntos de parámetros

DisplayName
Posición:Named
Mandatory:True
Valor de la canalización:False
Valor de la canalización por nombre de propiedad:False
Valor de los argumentos restantes:False

-Exclude

Specifies services that this cmdlet omits. The value of this parameter qualifies the Name parameter. Enter a name element or pattern, such as s*. Wildcard characters are permitted.

Propiedades del parámetro

Tipo:

String[]

Valor predeterminado:None
Admite caracteres comodín:True
DontShow:False

Conjuntos de parámetros

(All)
Posición:Named
Mandatory:False
Valor de la canalización:False
Valor de la canalización por nombre de propiedad:False
Valor de los argumentos restantes:False

-Include

Specifies services to resume. The value of this parameter qualifies Name parameter. Enter a name element or pattern, such as s*. Wildcard characters are permitted.

Propiedades del parámetro

Tipo:

String[]

Valor predeterminado:None
Admite caracteres comodín:True
DontShow:False

Conjuntos de parámetros

(All)
Posición:Named
Mandatory:False
Valor de la canalización:False
Valor de la canalización por nombre de propiedad:False
Valor de los argumentos restantes:False

-InputObject

Specifies ServiceController objects that represent the services to resumed. Enter a variable that contains the objects, or type a command or expression that gets the objects.

Propiedades del parámetro

Tipo:

ServiceController[]

Valor predeterminado:None
Admite caracteres comodín:False
DontShow:False

Conjuntos de parámetros

InputObject
Posición:0
Mandatory:True
Valor de la canalización:True
Valor de la canalización por nombre de propiedad:False
Valor de los argumentos restantes:False

-Name

Specifies the service names of the services to be resumed.

Propiedades del parámetro

Tipo:

String[]

Valor predeterminado:None
Admite caracteres comodín:False
DontShow:False
Alias:ServiceName

Conjuntos de parámetros

Default
Posición:0
Mandatory:True
Valor de la canalización:True
Valor de la canalización por nombre de propiedad:True
Valor de los argumentos restantes:False

-PassThru

Returns an object that represents the service. By default, this cmdlet does not generate any output.

Propiedades del parámetro

Tipo:SwitchParameter
Valor predeterminado:None
Admite caracteres comodín:False
DontShow:False

Conjuntos de parámetros

(All)
Posición:Named
Mandatory:False
Valor de la canalización:False
Valor de la canalización por nombre de propiedad:False
Valor de los argumentos restantes:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Propiedades del parámetro

Tipo:SwitchParameter
Valor predeterminado:False
Admite caracteres comodín:False
DontShow:False
Alias:wi

Conjuntos de parámetros

(All)
Posición:Named
Mandatory:False
Valor de la canalización:False
Valor de la canalización por nombre de propiedad:False
Valor de los argumentos restantes:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Entradas

ServiceController

You can pipe a service object to this cmdlet.

String

You can pipe a string that contains a service name to this cmdlet.

Salidas

None

By default, this cmdlet returns no output.

ServiceController

When you use the PassThru parameter, this cmdlet returns a ServiceController object representing the resumed service.

Notas

This cmdlet is only available on Windows platforms.

  • The status of services that have been suspended is Paused. When services are resumed, their status is Running.
  • Resume-Service can control services only when the current user has permission to do this. If a command does not work correctly, you might not have the required permissions.
  • To find the service names and display names of the services on your system, type Get-Service. The service names appear in the Name column, and the display names appear in the DisplayName column.