< Back
Get-MicrosoftHealthActivity
Post
NAME Get-MicrosoftHealthActivity
SYNOPSIS
Gets Microsoft Band Activity
SYNTAX
Get-MicrosoftHealthActivity [-activity] <String> [[-StartTime] <String>] [[-EndTime] <String>] [-Details
<SwitchParameter>] [-MapPoints <SwitchParameter>] [-MinuteSummaries <SwitchParameter>] [-InformationAction
<ActionPreference>] [-InformationVariable <String>] [<CommonParameters>]
DESCRIPTION
The Activity object represents activities a user has completed using the tiles on the Microsoft Band.
The following activities can be retrieved:
- Run
- Bike
- Free Play (Workout)
- Guided Workout
- Golf
- Sleep
PARAMETERS
-activity <String>
Required? true
Position? 0
Default value
Accept pipeline input? false
Accept wildcard characters? false
-StartTime <String>
Required? false
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-EndTime <String>
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Details [<SwitchParameter>]
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-MapPoints [<SwitchParameter>]
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-MinuteSummaries [<SwitchParameter>]
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-InformationAction <ActionPreference>
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-InformationVariable <String>
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
System.Management.Automation.PSCustomObject
NOTES
-------------------------- EXAMPLE 1 --------------------------
Get-MicrosoftHealthActivity -Activity Run
Gets collection of Run Activities
activityType : Run
performanceSummary : @{finishHeartRate=188; heartRateZones=}
distanceSummary : @{period=Activity; totalDistance=552745; actualDistance=552957; elevationGain=2500;
elevationLoss=2700; maxElevation=300;
minElevation=-600; waypointDistance=2500; pace=371116}
splitDistance : 160934
id : 2519507490576132521
startTime : 2015-12-31T08:49:02.386+00:00
endTime : 2015-12-31T09:23:13.386+00:00
dayId : 2015-12-31T00:00:00.000+00:00
duration : PT34M11S
caloriesBurnedSummary : @{period=Activity; totalCalories=518}
heartRateSummary : @{period=Activity; averageHeartRate=165; peakHeartRate=195; lowestHeartRate=72}
-------------------------- EXAMPLE 2 --------------------------
Get-MicrosoftHealthActivity -Activity Bike
-------------------------- EXAMPLE 3 --------------------------
Get-MicrosoftHealthActivity -activity Run -Details -MapPoints -MinuteSummaries
activityType : Run
activitySegments : {@{segmentId=635871485423867478; startTime=2015-12-31T08:49:02.386+00:00;
endTime=2015-12-31T08:58:31.386+00:00; duration=PT9M29S;
heartRateSummary=; caloriesBurnedSummary=; segmentType=Run},
@{segmentId=635871491118373752; startTime=2015-12-31T08:58:31.837+00:00;
endTime=2015-12-31T09:10:04.837+00:00; duration=PT11M33S; heartRateSummary=;
caloriesBurnedSummary=; segmentType=Run},
@{segmentId=635871498058250108; startTime=2015-12-31T09:10:05.825+00:00;
endTime=2015-12-31T09:19:20.825+00:00; duration=PT9M15S;
heartRateSummary=; caloriesBurnedSummary=; segmentType=Run},
@{segmentId=635871503619089263; startTime=2015-12-31T09:19:21.908+00:00;
endTime=2015-12-31T09:23:13.908+00:00; duration=PT3M52S; heartRateSummary=;
caloriesBurnedSummary=; segmentType=Run}}
performanceSummary : @{finishHeartRate=188; heartRateZones=}
distanceSummary : @{period=Activity; totalDistance=552745; actualDistance=552957; elevationGain=2500;
elevationLoss=2700; maxElevation=300;
minElevation=-600; waypointDistance=2500; pace=371116}
splitDistance : 160934
mapPoints : {@{mapPointType=Start; ordinal=0; heartRate=97; pace=2222000; speed=45; isPaused=False;
isResume=False}, @{secondsSinceStart=17;
mapPointType=Waypoint; ordinal=1; actualDistance=2636; totalDistance=2636; heartRate=97;
pace=526000; scaledPace=2; speed=190;
location=; isPaused=False; isResume=False}, @{secondsSinceStart=25; mapPointType=Waypoint;
ordinal=2; actualDistance=5082;
totalDistance=5082; heartRate=97; pace=375000; scaledPace=13; speed=266; location=;
isPaused=False; isResume=False},
@{secondsSinceStart=32; mapPointType=Waypoint; ordinal=3; actualDistance=7515;
totalDistance=7515; heartRate=97; pace=342000;
scaledPace=59; speed=292; location=; isPaused=False; isResume=False}...}
id : 2519507490576132521
startTime : 2015-12-31T08:49:02.386+00:00
endTime : 2015-12-31T09:23:13.386+00:00
dayId : 2015-12-31T00:00:00.000+00:00
duration : PT34M11S
minuteSummaries : {@{userId=a254gg98-9e56-234e-96a4-b5a71f775abc; startTime=2015-12-31T09:23:00.000+00:00;
endTime=2015-12-31T09:24:00.000+00:00;
parentDay=0001-01-01T00:00:00.000+00:00; isTransitDay=False; period=Minute; duration=PT1M;
stepsTaken=178; caloriesBurnedSummary=;
heartRateSummary=; distanceSummary=}, @{userId=a254gg98-9e56-234e-96a4-b5a71f775abc;
startTime=2015-12-31T09:22:00.000+00:00;
endTime=2015-12-31T09:23:00.000+00:00; parentDay=0001-01-01T00:00:00.000+00:00;
isTransitDay=False; period=Minute; duration=PT1M;
stepsTaken=182; caloriesBurnedSummary=; heartRateSummary=; distanceSummary=},
@{userId=a254gg98-9e56-234e-96a4-b5a71f775abc;
startTime=2015-12-31T09:21:00.000+00:00; endTime=2015-12-31T09:22:00.000+00:00;
parentDay=0001-01-01T00:00:00.000+00:00;
isTransitDay=False; period=Minute; duration=PT1M; stepsTaken=182; caloriesBurnedSummary=;
heartRateSummary=; distanceSummary=},
@{userId=a254gg98-9e56-234e-96a4-b5a71f775abc; startTime=2015-12-31T09:20:00.000+00:00;
endTime=2015-12-31T09:21:00.000+00:00;
parentDay=0001-01-01T00:00:00.000+00:00; isTransitDay=False; period=Minute; duration=PT1M;
stepsTaken=184; caloriesBurnedSummary=;
heartRateSummary=; distanceSummary=}...}
caloriesBurnedSummary : @{period=Activity; totalCalories=518}
heartRateSummary : @{period=Activity; averageHeartRate=165; peakHeartRate=195; lowestHeartRate=72}
-------------------------- EXAMPLE 4 --------------------------
Get-MicrosoftHealthActivity -activity Run -Details -StartTime 10-01-2015 -EndTime 10-28-2015
Returns all Run Activities with Detailed information between dates 10-01-2015 and 10-28-2015
-------------------------- Example 5 --------------------------
Get-MicrosoftHealthActivity -activity Run -OutVariable run
$run | select-object *,@{L='totalCalories';E={$_.caloriesburnedsummary.totalcalories}} |
sort-object -Property totalCalories -Descending | select-object -First 1
Retrieve Best Burn (total calories burned) for Run Activity
ActivityType : Run
performanceSummary : @{heartRateZones=}
distanceSummary : @{period=Activity; totalDistance=826707; actualDistance=826707; elevationGain=5400;
elevationLoss=4900; maxElevation=500;
minElevation=-300; waypointDistance=2500; pace=609017}
splitDistance : 160934
id : 2519547244055907113
startTime : 2015-11-15T08:33:14.409+00:00
endTime : 2015-11-15T09:57:08.409+00:00
dayId : 2015-11-15T00:00:00.000+00:00
duration : PT1H23M54S
caloriesBurnedSummary : @{period=Activity; totalCalories=1122}
heartRateSummary : @{period=Activity; averageHeartRate=158; peakHeartRate=189; lowestHeartRate=77}
totalCalories : 1122
-------------------------- Example 6 --------------------------
Get-MicrosoftHealthActivity -activity Run -OutVariable run
$run | select-object *,@{L='pace';E={$_.distanceSummary.pace}} |
sort-object -Property pace | select-object -First 1
Retrieve Best Average Pace for Run Activity
activityType : Run
performanceSummary : @{finishHeartRate=173; heartRateZones=}
distanceSummary : @{period=Activity; totalDistance=762962;
actualDistance=763173; elevationGain=5700;
elevationLoss=5600; maxElevation=1800;
minElevation=200; waypointDistance=2500; pace=319958}
splitDistance : 160934
id : 2519523864144954331
startTime : 2015-12-12T09:59:45.504+00:00
endTime : 2015-12-12T10:40:26.504+00:00
dayId : 2015-12-12T00:00:00.000+00:00
name : 7.6 km van Egmond
duration : PT40M41S
caloriesBurnedSummary : @{period=Activity; totalCalories=433}
heartRateSummary : @{period=Activity; averageHeartRate=183;
peakHeartRate=184; lowestHeartRate=70}
pace : 319958
RELATED LINKS
Microsoft Health Cloud API V1 http://developer.microsoftband.com/clou ... vities_Get
SYNOPSIS
Gets Microsoft Band Activity
SYNTAX
Get-MicrosoftHealthActivity [-activity] <String> [[-StartTime] <String>] [[-EndTime] <String>] [-Details
<SwitchParameter>] [-MapPoints <SwitchParameter>] [-MinuteSummaries <SwitchParameter>] [-InformationAction
<ActionPreference>] [-InformationVariable <String>] [<CommonParameters>]
DESCRIPTION
The Activity object represents activities a user has completed using the tiles on the Microsoft Band.
The following activities can be retrieved:
- Run
- Bike
- Free Play (Workout)
- Guided Workout
- Golf
- Sleep
PARAMETERS
-activity <String>
Required? true
Position? 0
Default value
Accept pipeline input? false
Accept wildcard characters? false
-StartTime <String>
Required? false
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-EndTime <String>
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Details [<SwitchParameter>]
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-MapPoints [<SwitchParameter>]
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-MinuteSummaries [<SwitchParameter>]
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-InformationAction <ActionPreference>
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-InformationVariable <String>
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
System.Management.Automation.PSCustomObject
NOTES
-------------------------- EXAMPLE 1 --------------------------
Get-MicrosoftHealthActivity -Activity Run
Gets collection of Run Activities
activityType : Run
performanceSummary : @{finishHeartRate=188; heartRateZones=}
distanceSummary : @{period=Activity; totalDistance=552745; actualDistance=552957; elevationGain=2500;
elevationLoss=2700; maxElevation=300;
minElevation=-600; waypointDistance=2500; pace=371116}
splitDistance : 160934
id : 2519507490576132521
startTime : 2015-12-31T08:49:02.386+00:00
endTime : 2015-12-31T09:23:13.386+00:00
dayId : 2015-12-31T00:00:00.000+00:00
duration : PT34M11S
caloriesBurnedSummary : @{period=Activity; totalCalories=518}
heartRateSummary : @{period=Activity; averageHeartRate=165; peakHeartRate=195; lowestHeartRate=72}
-------------------------- EXAMPLE 2 --------------------------
Get-MicrosoftHealthActivity -Activity Bike
-------------------------- EXAMPLE 3 --------------------------
Get-MicrosoftHealthActivity -activity Run -Details -MapPoints -MinuteSummaries
activityType : Run
activitySegments : {@{segmentId=635871485423867478; startTime=2015-12-31T08:49:02.386+00:00;
endTime=2015-12-31T08:58:31.386+00:00; duration=PT9M29S;
heartRateSummary=; caloriesBurnedSummary=; segmentType=Run},
@{segmentId=635871491118373752; startTime=2015-12-31T08:58:31.837+00:00;
endTime=2015-12-31T09:10:04.837+00:00; duration=PT11M33S; heartRateSummary=;
caloriesBurnedSummary=; segmentType=Run},
@{segmentId=635871498058250108; startTime=2015-12-31T09:10:05.825+00:00;
endTime=2015-12-31T09:19:20.825+00:00; duration=PT9M15S;
heartRateSummary=; caloriesBurnedSummary=; segmentType=Run},
@{segmentId=635871503619089263; startTime=2015-12-31T09:19:21.908+00:00;
endTime=2015-12-31T09:23:13.908+00:00; duration=PT3M52S; heartRateSummary=;
caloriesBurnedSummary=; segmentType=Run}}
performanceSummary : @{finishHeartRate=188; heartRateZones=}
distanceSummary : @{period=Activity; totalDistance=552745; actualDistance=552957; elevationGain=2500;
elevationLoss=2700; maxElevation=300;
minElevation=-600; waypointDistance=2500; pace=371116}
splitDistance : 160934
mapPoints : {@{mapPointType=Start; ordinal=0; heartRate=97; pace=2222000; speed=45; isPaused=False;
isResume=False}, @{secondsSinceStart=17;
mapPointType=Waypoint; ordinal=1; actualDistance=2636; totalDistance=2636; heartRate=97;
pace=526000; scaledPace=2; speed=190;
location=; isPaused=False; isResume=False}, @{secondsSinceStart=25; mapPointType=Waypoint;
ordinal=2; actualDistance=5082;
totalDistance=5082; heartRate=97; pace=375000; scaledPace=13; speed=266; location=;
isPaused=False; isResume=False},
@{secondsSinceStart=32; mapPointType=Waypoint; ordinal=3; actualDistance=7515;
totalDistance=7515; heartRate=97; pace=342000;
scaledPace=59; speed=292; location=; isPaused=False; isResume=False}...}
id : 2519507490576132521
startTime : 2015-12-31T08:49:02.386+00:00
endTime : 2015-12-31T09:23:13.386+00:00
dayId : 2015-12-31T00:00:00.000+00:00
duration : PT34M11S
minuteSummaries : {@{userId=a254gg98-9e56-234e-96a4-b5a71f775abc; startTime=2015-12-31T09:23:00.000+00:00;
endTime=2015-12-31T09:24:00.000+00:00;
parentDay=0001-01-01T00:00:00.000+00:00; isTransitDay=False; period=Minute; duration=PT1M;
stepsTaken=178; caloriesBurnedSummary=;
heartRateSummary=; distanceSummary=}, @{userId=a254gg98-9e56-234e-96a4-b5a71f775abc;
startTime=2015-12-31T09:22:00.000+00:00;
endTime=2015-12-31T09:23:00.000+00:00; parentDay=0001-01-01T00:00:00.000+00:00;
isTransitDay=False; period=Minute; duration=PT1M;
stepsTaken=182; caloriesBurnedSummary=; heartRateSummary=; distanceSummary=},
@{userId=a254gg98-9e56-234e-96a4-b5a71f775abc;
startTime=2015-12-31T09:21:00.000+00:00; endTime=2015-12-31T09:22:00.000+00:00;
parentDay=0001-01-01T00:00:00.000+00:00;
isTransitDay=False; period=Minute; duration=PT1M; stepsTaken=182; caloriesBurnedSummary=;
heartRateSummary=; distanceSummary=},
@{userId=a254gg98-9e56-234e-96a4-b5a71f775abc; startTime=2015-12-31T09:20:00.000+00:00;
endTime=2015-12-31T09:21:00.000+00:00;
parentDay=0001-01-01T00:00:00.000+00:00; isTransitDay=False; period=Minute; duration=PT1M;
stepsTaken=184; caloriesBurnedSummary=;
heartRateSummary=; distanceSummary=}...}
caloriesBurnedSummary : @{period=Activity; totalCalories=518}
heartRateSummary : @{period=Activity; averageHeartRate=165; peakHeartRate=195; lowestHeartRate=72}
-------------------------- EXAMPLE 4 --------------------------
Get-MicrosoftHealthActivity -activity Run -Details -StartTime 10-01-2015 -EndTime 10-28-2015
Returns all Run Activities with Detailed information between dates 10-01-2015 and 10-28-2015
-------------------------- Example 5 --------------------------
Get-MicrosoftHealthActivity -activity Run -OutVariable run
$run | select-object *,@{L='totalCalories';E={$_.caloriesburnedsummary.totalcalories}} |
sort-object -Property totalCalories -Descending | select-object -First 1
Retrieve Best Burn (total calories burned) for Run Activity
ActivityType : Run
performanceSummary : @{heartRateZones=}
distanceSummary : @{period=Activity; totalDistance=826707; actualDistance=826707; elevationGain=5400;
elevationLoss=4900; maxElevation=500;
minElevation=-300; waypointDistance=2500; pace=609017}
splitDistance : 160934
id : 2519547244055907113
startTime : 2015-11-15T08:33:14.409+00:00
endTime : 2015-11-15T09:57:08.409+00:00
dayId : 2015-11-15T00:00:00.000+00:00
duration : PT1H23M54S
caloriesBurnedSummary : @{period=Activity; totalCalories=1122}
heartRateSummary : @{period=Activity; averageHeartRate=158; peakHeartRate=189; lowestHeartRate=77}
totalCalories : 1122
-------------------------- Example 6 --------------------------
Get-MicrosoftHealthActivity -activity Run -OutVariable run
$run | select-object *,@{L='pace';E={$_.distanceSummary.pace}} |
sort-object -Property pace | select-object -First 1
Retrieve Best Average Pace for Run Activity
activityType : Run
performanceSummary : @{finishHeartRate=173; heartRateZones=}
distanceSummary : @{period=Activity; totalDistance=762962;
actualDistance=763173; elevationGain=5700;
elevationLoss=5600; maxElevation=1800;
minElevation=200; waypointDistance=2500; pace=319958}
splitDistance : 160934
id : 2519523864144954331
startTime : 2015-12-12T09:59:45.504+00:00
endTime : 2015-12-12T10:40:26.504+00:00
dayId : 2015-12-12T00:00:00.000+00:00
name : 7.6 km van Egmond
duration : PT40M41S
caloriesBurnedSummary : @{period=Activity; totalCalories=433}
heartRateSummary : @{period=Activity; averageHeartRate=183;
peakHeartRate=184; lowestHeartRate=70}
pace : 319958
RELATED LINKS
Microsoft Health Cloud API V1 http://developer.microsoftband.com/clou ... vities_Get