Restart-Service - Powershell 1.0 CmdLet
Microsoft Windows PowerShell is a command-line shell and scripting tool based on the Microsoft .NET Framework. It is designed for system administrators, engineers and developers to control and automate the administration of Windows and applications.
More than hundred command-line tools (so called "cmdlets") can be used to perform system administration tasks and Windows Management Instrumentation (WMI). These cmdlets are easy to use, with standard naming conventions and common parameters, and standard tools for piping, sorting, filtering, and formatting data and objects.
Restart-Service
Description Stop and then restart a service Usage Options -name string The service names to be restarted. -displayName string The display names to be restarted, wildcards are permitted. -inputObject ServiceController Restart the services represented by ServiceController. Enter a command, expression or variable contains the objects. -force Override restrictions that prevent the command from succeeding, apart from security settings. e.g. -Force will stop and restart a service that has dependent services. -include string Restart only the specified services. qualifies the Name parameter. Wildcards , such as "s*" are permitted. -exclude string Omit the specified services e.g. "*SS64*" this only works when the path includes a wildcard character. -passThru Pass the object created by Restart-Service along the pipeline. -whatIf Describe what would happen if you executed the command without actually executing the command. -confirm Prompt for confirmation before executing the command. CommonParameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutVariable. Example(s) Restart the spooler (printing) service: PS C:\>restart-service spooler -force Find all the network services on the computer (starting with "net...") and restart any that are stopped: PS C:\>get-service net* | where {$_.Status -eq "Stopped"} | restart-service