The Get-ServiceFabricPartitionHealth cmdlet gets the health of a Service Fabric partition.
If you specify a partition that does not exist in the health store, this cmdlet returns an error.
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 health events for of a service partition
The first command uses the Get-ServiceFabricPartition cmdlet to get the singleton service partition object for the specified service, and then stores the object in the $ToDoPartition01 variable.
The second command gets the health of the partition by using the PartitionId property of the object stored in $ToDoPartition01.
Example 2: Query the health of a service partition using custom health policy and return filters
This command queries the health of the partitions of the specified service.
It uses custom health policy and filter to return only Error events.
Parameters
-ConsiderWarningAsError
Indicates whether to treat a warning health report as error during health evaluation.
Parameter properties
Type:
Boolean
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-EventsFilter
Specifies the filter for the collection of HealthEvents reported on the partition based on health state.
The value can be obtained from members or bitwise operations on members of HealthStateFilter.
Only events that match the filter are returned.
All events are used to evaluate the partition's aggregated health state.
If not specified, all entries are returned.
Parameter properties
Type:
HealthStateFilter
Default value:
None
Accepted values:
Default, None, Ok, Warning, Error, All
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-EventsHealthStateFilter
This parameter has been deprecated.
Specify the EventsFilter parameter instead.
Parameter properties
Type:
Int64
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ExcludeHealthStatistics
Indicates whether the health statistics should be included in the query result. If specified, the health statistics are not returned as part of the query result. Otherwise, the query result includes the partition health statistics, which contain information about how many replicas are in Ok, Warning, and Error states.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-MaxPercentUnhealthyReplicasPerPartition
Specifies the maximum tolerated percentage of unhealthy replicas in a partition.
If there are more replicas with a health state error than tolerated, the health state of the partition is error.
Parameter properties
Type:
Byte
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-PartitionId
Specifies the ID of a Service Fabric partition.
Parameter properties
Type:
Guid
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
0
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
True
Value from remaining arguments:
False
-ReplicasFilter
Specifies the filter for ReplicaHealthState children based on health state.
The value can be obtained from members or bitwise operations on members of HealthStateFilter.
Only children that match the filter are returned.
All children are used to evaluate the entity aggregated health state.
If not specified, all entries are returned.
Parameter properties
Type:
HealthStateFilter
Default value:
None
Accepted values:
Default, None, Ok, Warning, Error, All
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ReplicasHealthStateFilter
This parameter has been deprecated.
Specify the ReplicasFilter parameter instead.
Parameter properties
Type:
Int64
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-TimeoutSec
Specifies the time-out period, in seconds, for the operation.
Parameter properties
Type:
Int32
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.