Test-ServiceFabricClusterConnection
检查并确认是否已连接到 Service Fabric 群集。
语法
Default (默认值)
Test-ServiceFabricClusterConnection
[-AllowNetworkConnectionOnly]
[-TimeoutSec <Int32>]
[<CommonParameters>]
说明
Test-ServiceFabricClusterConnection cmdlet 测试与 Service Fabric 群集的连接是否存在。 在 Service Fabric 群集上执行任何操作之前,请使用 Connect-ServiceFabricCluster cmdlet 建立与群集的连接。
示例
示例 1:测试是否存在与群集的当前连接
PS C:\> Test-ServiceFabricClusterConnection
True
此命令验证与 Service Fabric 群集的当前连接是否存在。
示例 2:测试是否存在与群集的当前连接
PS C:\> Test-ServiceFabricClusterConnection
Test-ServiceFabricClusterConnection:群集连接实例为 null
在这种情况下,与 Service Fabric 群集的当前连接不存在,必须使用 Connect-ServiceFabricCluster cmdlet 进行设置。
参数
-AllowNetworkConnectionOnly
指示如果 cmdlet 可以连接到群集,即使系统服务无响应,该 cmdlet 也会返回“True”。 也就是说,只要基础网络连接可以建立到群集,它就会返回“True”。
参数属性
| 类型: | SwitchParameter |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-TimeoutSec
指定操作的超时期限(以秒为单位)。
参数属性
| 类型: | Int32 |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。