You are here:

WindowsManagement.com > PowerShell > PowerShell 1.0 > Suspend-Service
ActiveXperts Network Monitor 2019 proactively manages network servers, devices, databases and more.

Suspend-Service - PowerShell 1.0

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.

Suspend-Service


Description
Back up your Hyper-V VMs Easy & Fast. 100% built for Hyper-V. Free for 2 VMs, forever.

Usage


Options
-name string
       The service names to be suspended.
   	
   -displayName string
       The display names to be suspended, wildcards are permitted.

   -inputObject ServiceController
       Suspend the services represented by ServiceController.
       Enter a command, expression or variable contains the objects.

   -include string
       Suspend 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 Suspend-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)
Suspend the Telnet service (Tlntsvr) service:

PS C:\>suspend-service -displayname "Telnet"

Use the pipeline operator to pass an object from Get-service to Suspend-service:

PS C:\>get-service schedule | suspend-service

Suspend all services that can be suspended, this is done by selecting only services with a value of "True" for the CanPauseAndContinue property:

PS C:\>get-service | where-object {$_.CanPauseAndContinue -eq "True"} | suspend-service -confirm