Test-​Service​Fabric​Cluster​Connection

Checks and confirms (by returning "True") that you are connected to a Service Fabric cluster.

Syntax

Test-ServiceFabricClusterConnection
    [-AllowNetworkConnectionOnly]
    [-TimeoutSec <Int32>]
    [<CommonParameters>]

Description

The Test-ServiceFabricClusterConnection cmdlet tests whether a connection to a Service Fabric cluster exists. 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: Test that a current connection to a cluster exists

PS C:\> Test-ServiceFabricClusterConnection
True

This command verifies that a current connection to a Service Fabric cluster exists.

Example 2: Test that a current connection to a cluster exists

PS C:\> Test-ServiceFabricClusterConnection

Test-ServiceFabricClusterConnection : Cluster connection instance is null

In this case, a current connection to a Service Fabric cluster does not exist and has to be set up using the Connect-ServiceFabricCluster cmdlet.

Optional Parameters

-AllowNetworkConnectionOnly

When set, the cmdlet will return "True" if it can connect to the cluster even when system services are unresponsive. That is, as long as an underlying network connection can be established to the cluster, it will return "True".

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
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

None

You cannot pipe input to this cmdlet.

Outputs

System.Object

This cmdlet returns $True if the Service Fabric cluster connection is valid, or, if it is not valid, this cmdlet returns $False.