Skip to content

Commit

Permalink
parameter and help fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhitsolutions committed Sep 2, 2020
1 parent 7ce099a commit 4f95ef0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
14 changes: 7 additions & 7 deletions docs/Show-Calendar.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Display a colorized calendar month in the console.
## SYNTAX

```yaml
Show-Calendar [[-Month] <String>] [[-Year] <Int32>] [-HighlightDate <String[]>] [-Position <Coordinates>]
Show-Calendar [[-Month] <String>] [[-Year] <Int32>] [-HighlightDate <DateTime[]>] [-Position <Coordinates>]
[<CommonParameters>]
```

## DESCRIPTION

This command is a wrapper for Get-Calendar that essentially shows the same result. The only difference is that you can use Show-Calendar to display the calendar at a specific position in your PowerShell session. This function is also retained for backwards compatibility.
This command is a wrapper for Get-Calendar that essentially shows the same result. The only difference is that you can use Show-Calendar to display the calendar at a specific position in your PowerShell session. This function is also retained for backward compatibility.

## EXAMPLES

Expand All @@ -35,10 +35,10 @@ Display a colorized version of the current month.
### EXAMPLE 2

```powershell
PS C:\> Show-Calendar -Month February -Year 2020 -HighlightDate 2/22/20
PS C:\> Show-Calendar -Month February -Year 2021 -HighlightDate 2/22/21
```

Display February 2020 and highlight the 22nd using the default highlight color.
Display February 2021 and highlight the 22nd using the default highlight color.

### Example 3

Expand Down Expand Up @@ -84,16 +84,16 @@ Accept wildcard characters: False
### -HighlightDate
Specific days (named) to highlight. These dates are colored by ANSI escape sequences. You can modify them with Set-PSCalendarConfiguration.
Specify days to highlight. These dates are colored by ANSI escape sequences. You can modify them with Set-PSCalendarConfiguration.
```yaml
Type: String[]
Type: DateTime[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: (Get-Date).date.toString()
Default value:
Accept pipeline input: False
Accept wildcard characters: False
```
Expand Down
2 changes: 1 addition & 1 deletion docs/Show-GuiCalendar.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Show-GuiCalendar [[-Start] <DateTime>] [[-End] <DateTime>] [-HighlightDate <Date

## DESCRIPTION

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 fine0tune 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.
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.

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.

Expand Down
24 changes: 12 additions & 12 deletions en-us/PSCalendar-help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ Highlight : `e[92m</dev:code>
</maml:description>
</command:details>
<maml:description>
<maml:para>This command is a wrapper for Get-Calendar that essentially shows the same result. The only difference is that you can use Show-Calendar to display the calendar at a specific position in your PowerShell session. This function is also retained for backwards compatibility.</maml:para>
<maml:para>This command is a wrapper for Get-Calendar that essentially shows the same result. The only difference is that you can use Show-Calendar to display the calendar at a specific position in your PowerShell session. This function is also retained for backward compatibility.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
Expand Down Expand Up @@ -560,14 +560,14 @@ Highlight : `e[92m</dev:code>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>HighlightDate</maml:name>
<maml:Description>
<maml:para>Specific days (named) to highlight. These dates are colored by ANSI escape sequences. You can modify them with Set-PSCalendarConfiguration.</maml:para>
<maml:para>Specify days to highlight. These dates are colored by ANSI escape sequences. You can modify them with Set-PSCalendarConfiguration.</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">String[]</command:parameterValue>
<command:parameterValue required="true" variableLength="false">DateTime[]</command:parameterValue>
<dev:type>
<maml:name>String[]</maml:name>
<maml:name>DateTime[]</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>(Get-Date).date.toString()</dev:defaultValue>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Position</maml:name>
Expand Down Expand Up @@ -611,14 +611,14 @@ Highlight : `e[92m</dev:code>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>HighlightDate</maml:name>
<maml:Description>
<maml:para>Specific days (named) to highlight. These dates are colored by ANSI escape sequences. You can modify them with Set-PSCalendarConfiguration.</maml:para>
<maml:para>Specify days to highlight. These dates are colored by ANSI escape sequences. You can modify them with Set-PSCalendarConfiguration.</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">String[]</command:parameterValue>
<command:parameterValue required="true" variableLength="false">DateTime[]</command:parameterValue>
<dev:type>
<maml:name>String[]</maml:name>
<maml:name>DateTime[]</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>(Get-Date).date.toString()</dev:defaultValue>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Position</maml:name>
Expand Down Expand Up @@ -669,9 +669,9 @@ Highlight : `e[92m</dev:code>
</command:example>
<command:example>
<maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title>
<dev:code>PS C:\&gt; Show-Calendar -Month February -Year 2020 -HighlightDate 2/22/20</dev:code>
<dev:code>PS C:\&gt; Show-Calendar -Month February -Year 2021 -HighlightDate 2/22/21</dev:code>
<dev:remarks>
<maml:para>Display February 2020 and highlight the 22nd using the default highlight color.</maml:para>
<maml:para>Display February 2021 and highlight the 22nd using the default highlight color.</maml:para>
</dev:remarks>
</command:example>
<command:example>
Expand Down Expand Up @@ -707,7 +707,7 @@ Highlight : `e[92m</dev:code>
</maml:description>
</command:details>
<maml:description>
<maml:para>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 fine0tune 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.</maml:para>
<maml:para>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.</maml:para>
<maml:para>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.</maml:para>
</maml:description>
<command:syntax>
Expand Down
4 changes: 2 additions & 2 deletions functions/public.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ Function Show-Calendar {
[ValidatePattern('^\d{4}$')]
[int]$Year = (Get-Date).Year,

[string[]]$HighlightDate = (Get-Date).date.toString(),
[datetime[]]$HighlightDate,

[System.Management.Automation.Host.Coordinates]$Position
)
Expand All @@ -493,7 +493,7 @@ Function Show-Calendar {
}

#add default values if not bound
$params = "Month", "Year", "HighlightDate"
$params = "Month", "Year"
foreach ($param in $params) {
if (-not $PSBoundParameters.ContainsKey($param)) {
$PSBoundParameters.Add($param, $((Get-Variable -Name $param).value))
Expand Down

0 comments on commit 4f95ef0

Please sign in to comment.