1.

Tell about PowerShell’s Get-ServiceStatus function?

Answer»

The functions of Get-ServiceStatus allow filtering of window services. PowerShell documents the services that are both ‘Running’, and ‘Stopped’ during scripting. By default, when Get-Service is operated without parameters, all the local computer's services are returned. You can control this cmdlet to obtain only certain services by selecting the service name or the display name of the services, or you can PIPE service objects to this cmdlet.

  • EXAMPLE 1: Get all services on the computer
    This example fetches all of the services on the computer. It acts as THOUGH you TYPED Get-Service *. The default display displays the status, service name, and display name of each service.
    Get-Service
  • Example 2: Get services that commence with a search string
    This example recovers services with service NAMES that start with WMI (Windows Management Instrumentation).
    Get-Service "wmi*"


Discussion

No Comment Found