Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/Process-PSModule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ permissions:

jobs:
Process-PSModule:
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v5
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@releasenotes
secrets:
APIKey: ${{ secrets.APIKey }}
23 changes: 23 additions & 0 deletions src/functions/public/Get-Greeting.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
function Get-Greeting {
<#
.SYNOPSIS
Returns a greeting message.

.DESCRIPTION
Returns a simple greeting message for the specified time of day.

.EXAMPLE
Get-Greeting -TimeOfDay 'Morning'

Returns "Good Morning!"
#>
[OutputType([string])]
[CmdletBinding()]
param (
# The time of day for the greeting.
[Parameter()]
[ValidateSet('Morning', 'Afternoon', 'Evening')]
[string] $TimeOfDay = 'Morning'
)
"Good $TimeOfDay!"
}
8 changes: 8 additions & 0 deletions tests/PSModuleTest.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,12 @@ Describe 'Module' {
It 'Function: Get-PSModuleTest' {
Get-PSModuleTest -Name 'World' | Should -Be 'Hello, World!'
}

It 'Function: Get-Greeting - Default' {
Get-Greeting | Should -Be 'Good Morning!'
}

It 'Function: Get-Greeting - Evening' {
Get-Greeting -TimeOfDay 'Evening' | Should -Be 'Good Evening!'
}
}
Loading