Get-​Service​Fabric​Service

Gets a list of Service Fabric services.

Syntax

Get-ServiceFabricService
   [-Adhoc]
   [[-ServiceName] <Uri>]
   [-ServiceTypeName <String>]
   [-TimeoutSec <Int32>]
   [<CommonParameters>]
Get-ServiceFabricService
   [-ApplicationName] <Uri>
   [[-ServiceName] <Uri>]
   [-ServiceTypeName <String>]
   [-TimeoutSec <Int32>]
   [<CommonParameters>]

Description

The Get-ServiceFabricService cmdlet gets a list of Service Fabric services.

Before you perform any operation on a Service Fabric cluster, establish a connection to the cluster by using the Connect-ServiceFabricCluster cmdlet.

Examples

Example 1: Get the services created from an application

PS C:\> Get-ServiceFabricService -ApplicationName fabric:/myapp/persistenttodolist

This command gets the Service Fabric services from the specified application.

Example 2: Get the system services running in a cluster

PS C:\> Get-ServiceFabricService -ApplicationName fabric:/System

This command gets the Service Fabric system services running in a cluster.

Required Parameters

-Adhoc

Indicates that the service runs in ad hoc mode. In ad hoc mode, you manually activate the service host.

Type:SwitchParameter
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ApplicationName

Specifies the Uniform Resource Identifier (URI) of a Service Fabric application. The cmdlet gets the services for the applications that you specify.

Type:Uri
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-ServiceName

Specifies the URI of a Service Fabric service. If you do not specify this parameter, this cmdlet gets all services of the specified application.

Type:Uri
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ServiceTypeName

{{Fill ServiceTypeName Description}}

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-TimeoutSec

Specifies the time-out period, in seconds, for the operation.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.Uri

This cmdlet accept a URI that represents the name of a Service Fabric application or the name of a Service Fabric service.

Outputs

System.Object

This cmdlet returns a list of System.Fabric.Query.Service objects that represent Service Fabric services.