< Back

Get-Calendar

Sun Jan 19, 2020 6:18 pm

NAME Get-Calendar



SYNOPSIS

Displays a visual representation of a calendar.





SYNTAX

Get-Calendar [[-Month] <String>] [[-Year] <Int32>] [-HighlightDate <String[]>] [<CommonParameters>]



Get-Calendar -Start <DateTime> -End <DateTime> [-HighlightDate <String[]>] [<CommonParameters>]





DESCRIPTION

This command displays a visual representation of a calendar. It supports multiple months, as well as the ability

to highlight a specific date or dates.





PARAMETERS

-Month <String>

Select a month to display. The command will default to the current year unless otherwise specified.



Required? false

Position? 1

Default value current month

Accept pipeline input? False

Accept wildcard characters? false



-Year <Int32>

Select a year for the specified month.



Required? false

Position? 2

Default value Current year

Accept pipeline input? False

Accept wildcard characters? false



-Start <DateTime>

The first month to display.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-End <DateTime>

The last month to display.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-HighlightDate <String[]>

Specific days (named) to highlight. These dates are surrounded by asterisk characters.



Required? false

Position? named

Default value (Get-Date).date.toString()

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

System.String







NOTES





This command should have an alias of cal. The majority of this function was written by Lee Holmes at

http://www.leeholmes.com/blog/2008/12/0 ... -messages/



Learn more about PowerShell: http://jdhitsolutions.com/blog/essentia ... resources/



-------------------------- EXAMPLE 1 --------------------------



PS C:\\> Get-Calendar



September 2018



Sun Mon Tue Wed Thu Fri Sat

--- --- --- --- --- --- ---

26 27 28 29 30 31 1

2 3 4 5 6 7 8

9 10 11 12 13 14 15

16 17 18 19 20 21 22

23 24 25 *26* 27 28 29

30 1 2 3 4 5 6



Show the current calendar and highlight today. The month name will be centered in your output.

-------------------------- EXAMPLE 2 --------------------------



PS C:\\> Get-Calendar -start "3/1/2019" -end "5/1/2019"



March 2019



Sun Mon Tue Wed Thu Fri Sat

--- --- --- --- --- --- ---

24 25 26 27 28 1 2

3 4 5 6 7 8 9

10 11 12 13 14 15 16

17 18 19 20 21 22 23

24 25 26 27 28 29 30

31 1 2 3 4 5 6



April 2019



Sun Mon Tue Wed Thu Fri Sat

--- --- --- --- --- --- ---

7 8 9 10 11 12 13

14 15 16 17 18 19 20

21 22 23 24 25 26 27

28 29 30 1 2 3 4



May 2019



Sun Mon Tue Wed Thu Fri Sat

--- --- --- --- --- --- ---

5 6 7 8 9 10 11

12 13 14 15 16 17 18

19 20 21 22 23 24 25

26 27 28 29 30 31 1





-------------------------- EXAMPLE 3 --------------------------



PS C:\\> Get-Calendar -Start 12/1/2018 -end 12/1/2018 -HighlightDate 12/25/2018



December 2018



Sun Mon Tue Wed Thu Fri Sat

--- --- --- --- --- --- ---

25 26 27 28 29 30 1

2 3 4 5 6 7 8

9 10 11 12 13 14 15

16 17 18 19 20 21 22

23 24 *25* 26 27 28 29

30 31 1 2 3 4 5



Display a month and highlight a specific date.



RELATED LINKS

Online Version: http://bit.ly/31TNoP8

Get-Date

Show-Calendar

Show-GuiCalendar