Get-​Service​Fabric​Service​Name

Gets the name of the service for a Service Fabric partition.

Syntax

Get-ServiceFabricServiceName
   [-PartitionId] <Guid>
   [-TimeoutSec <Int32>]
   [<CommonParameters>]

Description

The Get-ServiceFabricServiceName cmdlet gets the name of the service for a Service Fabric partition.

The output of Get-ServiceFabricServiceName contains the following information:

--Service Name: The name of the service corresponding to the given partition.

Examples

Example 1: Get the service name for a partition

PS C:\> Get-ServiceFabricServiceName -PartitionId $ToDoPartition01.PartitionId

This command gets the name of the service by using the PartitionId property of the object stored in $ToDoPartition01.

Example 2: Restart the replica for a partition

PS C:\> Get-ServiceFabricServiceName -PartitionId $ToDoPartition01.PartitionId | Restart-ServiceFabricReplica

The Restart-ServiceFabricReplica cmdlet restarts the replica specified by the given ServiceName and PartitionId. This example restarts the replica for the $ToDoPartition01 partition by getting its ServiceName using the Get-ServiceFabricServiceName cmdlet and piping it, along with its PartitionId, to the Restart-ServiceFabricReplica cmdlet.

Required Parameters

-PartitionId

Specifies the ID of a Service Fabric partition.

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

Optional Parameters

-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.Guid

Outputs

System.Object