You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
54
-
FunctionsToExport=@('*')
55
-
56
-
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
63
-
AliasesToExport=@('*')
53
+
AliasesToExport=@('ncal','cal','gcal','scal')
64
54
65
55
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
@@ -24,27 +24,27 @@ __Note: If you are upgrading to v2.0.0 or later of this module, and have older v
24
24
25
25
The commands in this module have been updated to take advantage ANSI escape sequences. The main function, [Get-Calendar](docs/Get-Calendar.md), will display the current month in the console, highlighting the current date with an ANSI escape sequence.
26
26
27
-

27
+

28
28
29
29
But you can also specify a calendar by month and year.
30
30
31
-

31
+

32
32
33
33
In this example you can see that I specified dates to highlight. Or you can specify a range of months.
34
34
35
-

35
+

36
36
37
37
The function should be culturally aware. The commands in this module that have a `-Month` parameter should autocomplete to culture-specific month names.
There is a similar autocompletion for `-Year` that begins with the current year and then the next 5 years. Although nothing prevents you from entering any year you want.
42
42
43
43
## [Show-Calendar](docs/Show-Calendar.md)
44
44
45
45
In previous versions of this module, there was a command called `Show-Calendar` which wrote a colorized version of the calendar to the host using `Write-Host`. This command has been rewritten and now is essentially a wrapper for `Get-Calendar`. The primary difference is that you can position the calendar.
46
46
47
-

47
+

48
48
49
49
## A Console Calendar Prompt
50
50
@@ -91,19 +91,23 @@ Function prompt {
91
91
92
92
Assuming the width of your console is at least 120, this code should work. Otherwise, you might need to tweak the positioning. This should also work in Windows Terminal. If you add some highlighted dates using `$PSDefaultParameterValues`, then you'll have a calendar right in front of you.
93
93
94
-

94
+

95
95
96
96
Note that any command output may be truncated because of the calendar display. This prompt function works as expected when using the Windows Terminal. Function needs work to behave as expected in a traditional PowerShell console where you might have a large buffer for scrolling.
97
97
98
98
## [Show-GUICalendar](docs/Show-GuiCalendar)
99
99
100
-
Finally, you can display a graphical calendar using a Windows Presentation Foundation (WPF) based script. The function runs the calendar-related code in a runspace so it does not block your prompt. You can display up to 3 months and specify dates to highlight.
100
+
Finally, you can display a graphical calendar using a Windows Presentation Foundation (WPF) based script.
101
+
102
+
> :warning: This command is not supported in PowerShell 7 nor is it exported in the module.
103
+
104
+
The function runs the calendar-related code in a runspace so it does not block your prompt. You can display up to 3 months and specify dates to highlight.
The calendar form is transparent. But you should be able to click on it to drag it around your screen. You can also use the `+` and `-` keys to increase or decrease the calendar's opacity. Be aware that if you close the PowerShell session that launched the calendar, the calendar too will close.
109
113
@@ -113,23 +117,23 @@ Beginning with module version 2.2.0 you can also customize the calendar backgrou
On Windows platforms, the `-BackgroundColor` parameter will autocomplete the available brush colors.
127
131
128
132
## [Get-NCalendar](docs/Get-NCalendar.md)
129
133
130
134
The Linux world has an *ncal* command which displays the month in a vertical fashion. `Get-NCalendar` and its alias `ncal` work in a similar manner. The default is for the current month and year.
131
135
132
-

136
+

133
137
134
138
The current date will be highlighted unless you use `-HideHighlight`. You must use the full month name, although there is tab completion.
When you pass a hashtable, you will get a tooltip popup when you hover the mouse over the month.
214
218
215
-
g
219
+
g
216
220
217
221
This function requires the WPF-related assemblies. It should work in Windows PowerShell and PowerShell 7. You will receive a warning if any incompatibility is detected.
218
222
219
223
## Customizing the Calendar Appearance
220
224
221
225
Beginning with v2.0.0 of this module, ANSI escape sequences used to format the calendar are stored in module-scoped hashtable. You can use [Get-PSCalendarConfiguration](docs/Get-PSCalendarConfiguration.md) to view the current settings.
You need to include the escape character but you do not need to include the closing escape sequence.
230
234
231
-

235
+

232
236
233
237
This change lasts for the duration of your PowerShell session. If you want to make it more permanent, you will need to add the commands to your PowerShell profile script.
234
238
@@ -261,5 +265,3 @@ For example, if you are running under the `en-AU` culture, you would need to use
261
265
## Potential Issues
262
266
263
267
I have tried to make this module culture-aware. Testing across cultures is not an easy process. If you encounter a problem and are not running PowerShell under the `EN-US` culture, run the calendar command you are trying to use with `-Verbose` and post the results in a new issue. Or if you have both Windows PowerShell and PowerShell 7 installed, try the same command in both versions.
If you are running Windows PowerShell or a version of PowerShell that supports Windows Presentation Foundation (WPF), you can display a graphical calendar. You can specify up to 3 months. There are also parameters to fine-tune the calendar style. The calendar form itself is transparent, but you should be able to click on it to drag it around your screen. You can also use the + and - keys to increase or decrease the calendar's opacity. You may have to click on a calendar before making any adjustments.
44
+
If you are running Windows PowerShell or a version of PowerShell that supports the [System.Windows.Media] .NET class, which does NOT include PowerShell 7, you can display a graphical calendar. You can specify up to 3 months. There are also parameters to fine-tune the calendar style. The calendar form itself is transparent, but you should be able to click on it to drag it around your screen. You can also use the + and - keys to increase or decrease the calendar's opacity. You may have to click on a calendar before making any adjustments.
45
45
46
46
This command launches the calendar in a separate runspace so that it doesn't block your prompt. However, if you close the PowerShell session that launched the calendar, the calendar will also automatically close.
0 commit comments