Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Get JournalEntriesByTag

Nick Spreitzer edited this page Feb 17, 2020 · 12 revisions
external help file: JournalCli.dll-Help.xml
Module Name: JournalCli
online version:
schema: 2.0.0

Get-JournalEntriesByTag

SYNOPSIS

Returns a journal index consisting only of entries that contain specified tags and, optionally, falls within a specific date range.

Alias: gjt

SYNTAX

Get-JournalEntriesByTag -Tags <String[]> [-IncludeBodies] [-All] [-From <DateTime>] [-To <DateTime>]
 [-Location <String>] [<CommonParameters>]

DESCRIPTION

In contrast with Get-JournalIndex which returns an index of all entries, this cmdlet returns an index that only consists of entries containing specific tags and, optionally, filters out entries that were written outside a specific date range. By default, this cmdlet returns the headers from each included entry. The complete journal entry content is returned if the IncludeBodies switch is used. See the recipes page for examples of paginating through the full text content of each entry.

EXAMPLES

Example 1

> Get-JournalEntriesByTag -Tags work,vacation

Tag       Count Entries
---       ----- -------
work        141 {2018.01.08, 2018.01.09, 2018.01.10, 2018.01.11…}
vacation      1 {2019.10.11}

Returns all journal entries that are tagged either work or vacation.

Example 2

> Get-JournalEntriesByTag -Tags work,vacation -All

Tag         Count Entries
---         ----- -------
big-event       1 {2019.10.11}
coding          1 {2019.10.11}
work            1 {2019.10.11}
vacation        1 {2019.10.11}

Returns all journal entries that are tagged both work and vacation. In this example, there is only one matching entry, but the results are still indexed by tag which is why 4 results are listed - one for each tag contained in that entry.

Example 3

> Get-JournalEntriesByTag -Tags work,vacation -All |
	select entries |
	unique

Entries
-------
{2019.10.11}

Building on Example 2, this filters the results to only unique entries.

Example 4

> Get-JournalEntriesByTag -Tags work -From '2019.1.1' -To '2019.6.7'

Returns all journal entries that are tagged work and were written between January 1st 2019 and June 7th 2019.

PARAMETERS

-All

Filters included journal entries to those which include all specified tags.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-From

Filters included journal entries to those which were written on or after the specified date.

Type: DateTime
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-IncludeBodies

Includes the full text content of each returned journal entry.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Location

The root directory for the journal.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Tags

An array of tags used to filter the list of journal entries.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-To

Filters included journal entries to those which were written on or before the specified date.

Type: DateTime
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

JournalIndex<IJournalEntry>

NOTES

RELATED LINKS