Skip to content

New JournalEntry

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

New-JournalEntry

SYNOPSIS

Creates a new journal entry.

Alias: nj

SYNTAX

New-JournalEntry [-DateOffset <Int32>] [-Tags <String[]>] [-Readme <String>] [-Date <DateTime>]
 [-Location <String>] [<CommonParameters>]

DESCRIPTION

Creates a new markdown-based journal entry with the provided tags and readme value, and opens it for writing using the default editor for .md files. If an entry already exists for the specified date, you will be prompted to open it for further editing. In this case, the provided tags and readme value are discarded.

EXAMPLES

EXAMPLE 1

New-JournalEntry -Tags work,running,exciting-day

Creates a new journal entry for today, tagged running, work, and exciting-day.

EXAMPLE 2

New-JournalEntry -DateOffset -1

Creates a new journal entry for yesterday.

PARAMETERS

-Date

A specific date for which to create a new journal entry. You can use a string representation of a date, such as '2019.12.20', or create a date using, for example,Get-Date -Day 10 which replaces the Day element from current date with 10. If today is January 22, 2020, Get-Date -Day 10 would return January 10, 2020.

Type: DateTime
Parameter Sets: (All)
Aliases:

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

-Readme

A date expressed as a string, or a duration of time from the date of the journal entry, when the journal entry should be re-read.

Date Expressions

Date expressions are parsed using .NET's DateTime.Parse() method which can successfully handle any common culture-specific formats. Examples valid for United States English include:

  • 11/8/2019
  • 11/8/19
  • 11.8.2019
  • 11-8-2019
  • Friday November 8, 2019

Duration Expressions

Valid durations are expressed as an integer, followed by a single space, followed by one of the following periods:

  • day(s)
  • week(s)
  • month(s)
  • year(s)

Valid examples include:

  • "1 year"
  • "36 weeks"
  • "1024 days"
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 strings to apply to the entry as tags. Multiword tags should not have spaces. Instead, separate words by dashes or underscores.

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

None

OUTPUTS

System.Object

NOTES

RELATED LINKS

You can’t perform that action at this time.