Skip to content

Write-SpectreCalendar

Description

Writes a Spectre Console Calendar text to the console.


Examples

Example 1
This example demonstrates how to write a calendar to the console.

Write-SpectreCalendar -Date 2024-07-01 -Events @{'2024-07-10' = 'Beach time!'; '2024-07-20' = 'Barbecue' }

Example 2
This example demonstrates how to write a calendar to the console with some event details.

$events = @{
    '2024-01-10' = 'Hello World!'
    '2024-01-20' = 'Hello Universe!'
}
Write-SpectreCalendar -Date 2024-01-01 -Events $events

Parameters

Date

The date to display the calendar for.

TypeRequiredPositionPipelineInput
[DateTime]false1false

Alignment

The alignment of the calendar.

Valid Values:

  • Left
  • Right
  • Center
TypeRequiredPositionPipelineInput
[String]false2false

Color

The color of the calendar.

TypeRequiredPositionPipelineInput
[Color]false3false

Border

The border of the calendar.

Valid Values:

  • Ascii
  • Ascii2
  • AsciiDoubleHead
  • Double
  • DoubleEdge
  • Heavy
  • HeavyEdge
  • HeavyHead
  • Horizontal
  • Markdown
  • Minimal
  • MinimalDoubleHead
  • MinimalHeavyHead
  • None
  • Rounded
  • Simple
  • SimpleHeavy
  • Square
TypeRequiredPositionPipelineInput
[String]false4false

Culture

The culture of the calendar.

TypeRequiredPositionPipelineInput
[CultureInfo]false5false

Events

The events to highlight on the calendar. Takes a hashtable with the date as the key and the event as the value.

TypeRequiredPositionPipelineInput
[Hashtable]false6false

HideHeader

Hides the header of the calendar. (Date)

TypeRequiredPositionPipelineInput
[Switch]falsenamedfalse

PassThru

Returns the Spectre Calendar object instead of writing it to the console.

TypeRequiredPositionPipelineInput
[Switch]falsenamedfalse

Syntax

Write-SpectreCalendar [[-Date] <DateTime>] [[-Alignment] <String>] [[-Color] <Color>] [[-Border] <String>] [[-Culture] <CultureInfo>] [[-Events] <Hashtable>] [-HideHeader] [-PassThru] [<CommonParameters>]