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

Get JournalFiles

Nick Spreitzer edited this page Dec 24, 2019 · 2 revisions
external help file: JournalCli.dll-Help.xml
Module Name: JournalCli
online version:
schema: 2.0.0

Get-JournalFiles

SYNOPSIS

Returns journal entries as file objects, which enables text searching via the Select-String cmdlet.

SYNTAX

Get-JournalFiles [-From <DateTime>] [-To <DateTime>] [-Tags <String[]>] [-Location <String>]
 [<CommonParameters>]

DESCRIPTION

The primary purpose of this cmdlet is to enable text searching via PowerShell's Select-String cmdlet, which operates best when provided file objects. Use this cmdlet to retrieve a subset of journal entries, filtered by date and/or tags, and pipe the results into Select-String to get detailed information about where certain words or phrases can be found in your journal. Results include the entry file name, the matching line of text, and the line number where the text was found.

EXAMPLES

Example 1

PS C:\> Get-JournalFiles -Tags family | 
  Select-String 'christmas dinner' | 
  Format-Table -Property LineNumber,Line,FileName

Finds all journal entries that are tagged family, searches them for the phrase christmas dinner, and displays the line of text, line number, and file name where the phrase was found in a tabular format.

Example 2

PS C:\> Get-JournalFiles -From '2019.12.20' -To '2019.12.30' | 
  Select-String 'canasta' | 
  Format-Table -Property LineNumber,Line,FileName

Finds all journal entries created between December 20th, 2019 and December 30th 2019, searches them for the phrase canasta, and displays the line of text, line number, and file name where the phrase was found in a tabular format.

PARAMETERS

-From

Limits returned journal entries to those created 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

-Location

The root directory for the journal to search for entries. This is only required if no default journal location has been set, or to search a non-default location.

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: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-To

Limits returned journal entries to those created on or before the specified date. The default value is Today.

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

System.Object

NOTES

RELATED LINKS