Restarts a stopped service.
Snap-In: Microsoft.PowerShell.Management
Syntax:
Restart-Service
[-Name] <String[]> [-Force] [-PassThru] [-Include <String[]>] [-Exclude <String[]>] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-ErrorVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>] [-WhatIf] [-Confirm]
Restart-Service
[-Force] [-PassThru] -DisplayName <String[]> [-Include <String[]>] [-Exclude <String[]>] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-ErrorVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>] [-WhatIf] [-Confirm]
Restart-Service
[-Force] [-PassThru] [-Include <String[]>] [-Exclude <String[]>] [-InputObject <ServiceController[]>] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-ErrorVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>] [-WhatIf] [-Confirm]
Description:
The Restart-service Cmdlet sends a stop message to the service controller t o stop each service, and then a start message to start it again. If the service was already stopped, it will be started without an error indication.