| external help file | PSDates-help.xml |
|---|---|
| Module Name | PSDates |
| online version | |
| schema | 2.0.0 |
Groups objects by a specified time span.
Group-TimeSpan -InputObject <Object> -Years <Int32> [-IncludeAllTimes] [-ProgressAction <ActionPreference>] [-Property <String>] [<CommonParameters>]
Group-TimeSpan -InputObject <Object> -Months <Int32> [-IncludeAllTimes] [-ProgressAction <ActionPreference>] [-Property <String>] [<CommonParameters>]
Group-TimeSpan -Days <Int32> -InputObject <Object> [-IncludeAllTimes] [-ProgressAction <ActionPreference>] [-Property <String>] [<CommonParameters>]
Group-TimeSpan -Hours <Int32> -InputObject <Object> [-IncludeAllTimes] [-ProgressAction <ActionPreference>] [-Property <String>] [<CommonParameters>]
Group-TimeSpan -InputObject <Object> -Minutes <Int32> [-IncludeAllTimes] [-ProgressAction <ActionPreference>] [-Property <String>] [<CommonParameters>]
Group-TimeSpan -InputObject <Object> -Seconds <Int32> [-IncludeAllTimes] [-ProgressAction <ActionPreference>] [-Property <String>] [<CommonParameters>]
The Group-TimeSpan function takes a collection of objects and groups them based on a specified time span.
It supports grouping by properties such as days, hours, minutes, etc., allowing for flexible data grouping.
Get-ChildItem $PSHOME | Group-TimeSpan -Property CreationTime -Hours 1
Groups the files by each hour based on their CreationTime.
Get-ChildItem $PSHOME | Group-TimeSpan -Property CreationTime -Days 7
Groups the files by 7 days based on their CreationTime.
Specifies the number of days to group by.
Type: Int32
Parameter Sets: Days
Aliases:
Accepted values:
Required: True (Days) False (None)
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
DontShow: FalseSpecifies the number of hours to group by.
Type: Int32
Parameter Sets: Hours
Aliases:
Accepted values:
Required: True (Hours) False (None)
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
DontShow: False{{ Fill IncludeAllTimes Description }}
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Accepted values:
Required: True (None) False (All)
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
DontShow: FalseSpecifies the input objects to be grouped. This parameter accepts pipeline input.
Type: Object
Parameter Sets: (All)
Aliases: PSObject
Accepted values:
Required: True (All) False (None)
Position: Named
Default value:
Accept pipeline input: True
Accept wildcard characters: False
DontShow: FalseSpecifies the number of minutes to group by.
Type: Int32
Parameter Sets: Minutes
Aliases:
Accepted values:
Required: True (Minutes) False (None)
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
DontShow: FalseSpecifies the number of months to group by.
Type: Int32
Parameter Sets: Months
Aliases:
Accepted values:
Required: True (Months) False (None)
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
DontShow: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Accepted values:
Required: True (None) False (All)
Position: Named
Default value:
Accept pipeline input: False
Accept wildcard characters: False
DontShow: FalseSpecifies the property name of the InputObject to use for grouping. The property should be of a DateTime type.
Type: String
Parameter Sets: (All)
Aliases:
Accepted values:
Required: True (None) False (All)
Position: Named
Default value:
Accept pipeline input: False
Accept wildcard characters: False
DontShow: FalseSpecifies the number of seconds to group by.
Type: Int32
Parameter Sets: Seconds
Aliases:
Accepted values:
Required: True (Seconds) False (None)
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
DontShow: FalseSpecifies the number of years to group by.
Type: Int32
Parameter Sets: Years
Aliases:
Accepted values:
Required: True (Years) False (None)
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
DontShow: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Returns an array of TimeSpanGroupInfo objects.
Fill Related Links Here