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-CalendarEvent

Module PSWriteHTML

Allows adding new calendar events to calendar

Syntax

New-CalendarEvent [-AllDayEvent] [[-BackgroundColor] <String>] [[-BorderColor] <String>] [[-Color] <String>] [[-Constraint] <String>] [[-Description] <String>] [[-EndDate] <Nullable`1>] [[-StartDate] <DateTime>] [[-TargetName] <String>] [[-TextColor] <String>] [[-Title] <String>] [[-Url] <String>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Examples

Authored help example

EXAMPLE 1

New-HTMLCalendar {
    New-CalendarEvent -Title 'Active Directory Meeting' -Description 'We will talk about stuff' -StartDate (Get-Date)
    # End date is required for the colors to work...
    New-CalendarEvent -Title 'Lunch' -StartDate (Get-Date).AddDays(2).AddHours(-3) -EndDate (Get-Date).AddDays(3) -Description 'Very long lunch' -TextColor DeepSkyBlue -BackgroundColor yellow -BorderColor Red
}

Parameters

-AllDayEvent SwitchParameter optional
Determines if the event is shown in the “all-day” section of the view, if applicable. Determines if time text is displayed in the event. If this value is not specified, it will be inferred by the start and end properties
-BackgroundColor String optionalposition: 6
Sets backround color. Only works if EndDate is provided.
-BorderColor String optionalposition: 7
Sets border color. Only works if EndDate is provided.
-Color String optionalposition: 5
An alias for specifying the backgroundColor and borderColor at the same time.
-Constraint String optionalposition: 4
A groupId belonging to other events, "businessHours" or "availableForMeeting"
-Description String optionalposition: 1
The text that will appear on an event when hovering over
-EndDate Nullable`1 optionalposition: 3
hen your event ends. If your event is explicitly allDay, hour, minutes, seconds and milliseconds will be ignored. If omitted, your events will appear to have the default duration.
-StartDate DateTime optionalposition: 2
When your event begins. If your event is explicitly allDay, hour, minutes, seconds and milliseconds will be ignored.
-TargetName String optionalposition: 10
Specifies the name of the target frame or window. Default is _self
-TextColor String optionalposition: 8
Sets color of Text. Only works if EndDate is provided.
-Title String optionalposition: 0
The text that will appear on an event.
-Url String optionalposition: 9aliases: Uri
A URL that will be visited when this event is clicked by the user.

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.