Project

PSWriteHTML

Generate HTML reports, dashboards, and emails from PowerShell without writing HTML, CSS, or JavaScript.

Stars 1,019
Forks 115
Open issues 54
PowerShell Gallery downloads 7,576,901
Release v1.41.0
Language: PowerShell Updated: 2026-10-03
Command

New-HTMLCalendar

Module PSWriteHTML

Creates a new HTML calendar using FullCalendar library.

Syntax

New-HTMLCalendar [-BusinessHours] [[-CalendarSettings] <ScriptBlock>] [[-DefaultDate] <DateTime>] [-Editable] [[-EventLimit] <Boolean>] [[-EventTimeFormat] <IDictionary>] [[-HeaderCenter] <String[]>] [[-HeaderLeft] <String[]>] [[-HeaderRight] <String[]>] [[-InitialView] <String>] [[-NavigationLinks] <Boolean>] [[-NowIndicator] <Boolean>] [[-Selectable] <Boolean>] [[-SelectMirror] <Boolean>] [[-SlotLabelFormat] <IDictionary>] [[-UrlTarget] <String>] [[-WeekNumbers] <Boolean>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

This function creates a new HTML calendar using the FullCalendar library. It allows customization of various calendar settings such as header elements, initial view, default date, event handling, and more.

Examples

Authored help example

EXAMPLE 1

New-HTMLCalendar -CalendarSettings {
    # Define calendar settings here
}

Creates a new HTML calendar with default settings.

EXAMPLE 2

New-HTMLCalendar -CalendarSettings {
    # Define calendar settings here
} -HeaderLeft 'prev', 'next' -HeaderCenter 'title' -HeaderRight 'dayGridMonth', 'timeGridWeek' -DefaultDate (Get-Date) -NavigationLinks $true -NowIndicator $true -EventLimit $true -WeekNumbers $true -Selectable $true -SelectMirror $true -BusinessHours -Editable -InitialView 'dayGridMonth' -UrlTarget 'https://example.com' -EventTimeFormat @{
    hour           = '2-digit'
    minute         = '2-digit'
    omitZeroMinute = $false
    meridiem       = $false
    hour12         = $false
} -SlotLabelFormat @{
    hour           = '2-digit'
    minute         = '2-digit'
    omitZeroMinute = $false
    meridiem       = $false
    hour12         = $false
}

Creates a new HTML calendar with custom settings.

Parameters

-BusinessHours SwitchParameter optional
Indicates whether business hours are displayed on the calendar.
-CalendarSettings ScriptBlock optionalposition: 0
Specifies the script block containing settings for the calendar.
-DefaultDate DateTime optionalposition: 4
Specifies the default date to display on the calendar.
-Editable SwitchParameter optional
Indicates whether events are editable on the calendar.
-EventLimit Boolean optionalposition: 7
Indicates whether to limit the number of events displayed on a day.
-EventTimeFormat IDictionary optionalposition: 13
Specifies the format for displaying event times.
-HeaderCenter String[] optionalposition: 2
Specifies the element to display in the center of the calendar header.
Possible values: prev, next, today, prevYear, nextYear, dayGridDay, dayGridWeek, dayGridMonth, timeGridWeek, timeGridDay, listDay, listWeek, listMonth, title, listYear
-HeaderLeft String[] optionalposition: 1
Specifies the elements to display on the left side of the calendar header.
Possible values: prev, next, today, prevYear, nextYear, dayGridDay, dayGridWeek, dayGridMonth, timeGridWeek, timeGridDay, listDay, listWeek, listMonth, title, listYear
-HeaderRight String[] optionalposition: 3
Specifies the elements to display on the right side of the calendar header.
Possible values: prev, next, today, prevYear, nextYear, dayGridDay, dayGridWeek, dayGridMonth, timeGridWeek, timeGridDay, listDay, listWeek, listMonth, title, listYear
-InitialView String optionalposition: 11
Specifies the initial view of the calendar.
Possible values: dayGridDay, dayGridWeek, dayGridMonth, timeGridDay, timeGridWeek, listDay, listWeek, listMonth, listYear
Indicates whether navigation links are enabled on the calendar.
-NowIndicator Boolean optionalposition: 6
Indicates whether the current time indicator is displayed on the calendar.
-Selectable Boolean optionalposition: 9
Indicates whether events can be selected on the calendar.
-SelectMirror Boolean optionalposition: 10
Indicates whether a mirror effect is applied when selecting events.
-SlotLabelFormat IDictionary optionalposition: 14
Specifies the format for displaying slot labels.
-UrlTarget String optionalposition: 12
Specifies the target URL for calendar events.
-WeekNumbers Boolean optionalposition: 8
Indicates whether week numbers are displayed on the calendar.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.