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

Open JournalEntry

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

Open-JournalEntry

SYNOPSIS

Opens the specified journal entry using system's default editor for .md files.

Alias: oje

SYNTAX

Date (Default)

Open-JournalEntry [[-Date] <DateTime>] [-Location <String>] [<CommonParameters>]

Entry

Open-JournalEntry [[-Entry] <IJournalEntry>] [-Location <String>] [<CommonParameters>]

Last

Open-JournalEntry [-Last] [-Location <String>] [<CommonParameters>]

Name

Open-JournalEntry [[-EntryName] <String>] [-Location <String>] [<CommonParameters>]

DateOffset

Open-JournalEntry [[-DateOffset] <Int32>] [-Location <String>] [<CommonParameters>]

DESCRIPTION

Opens a specific journal entry for editing or reading using the system's default markdown editor. Entries can be referenced by relative or specific date, file name, or by piping in journal entry objects from other cmdlets.

EXAMPLES

Example 1

PS C:\> Open-JournalEntry '2019.01.02'
# Or...
PS C:\> Open-JournalEntry '2019.01.02.md'

Opens the entry for January 1, 2019. If an entry does not exist for that date, an error is returned.

Example 2

PS C:\> Open-JournalEntry (Get-Date -Year 2019 -Month 7 -Day 19)

Opens the entry for July 19th, 2019 or throws an error if it doesn't exist. Pro Tip: You can use Get-Date to swap out the day, year, or month value in order to easily produce the desired date. For example, if today's date is November 11th 2019 and I run Get-Date -Day 5, PowerShell will return November 5th 2019.

Example 3

PS C:\> Open-JournalEntry -DateOffset -1

Opens yesterday's entry.

Example 4

PS C:\> Get-JournalEntriesByTag -Tags insomnia | 
  			Select-Object -ExpandProperty entries | 
  			Open-JournalEntry

Opens every entry tagged insomnia. Careful here. If a large number of entries are returned by Get-JournalEntriesByTag, you may find yourself quickly overwhelmed by markdown editor instances.

PARAMETERS

-Date

The date of the entry to open.

Type: DateTime
Parameter Sets: Date
Aliases:

Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-DateOffset

An integer representing the number of days to offset from today's date. For example, -1 represents yesterday. The default is 0, meaning today.

Type: Int32
Parameter Sets: DateOffset
Aliases:

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

-Entry

An IJournalEntry object, generated from Get-JournalIndex or Get-JournalEntriesByTag. See Reading Entries With A Markdown Editor for additional information.

Type: IJournalEntry
Parameter Sets: Entry
Aliases:

Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-EntryName

The file name for a specific entry, with or with out the .md file extension.

Type: String
Parameter Sets: Name
Aliases:

Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Last

Opens the most recent journal entry.

Type: SwitchParameter
Parameter Sets: Last
Aliases:

Required: False
Position: 0
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

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

JournalCli.Core.IJournalEntry

System.String

System.DateTime

System.Int32

OUTPUTS

System.Object

NOTES

RELATED LINKS