diff --git a/.github/workflows/Process-PSModule.yml b/.github/workflows/Process-PSModule.yml index f3f57aa..eab069e 100644 --- a/.github/workflows/Process-PSModule.yml +++ b/.github/workflows/Process-PSModule.yml @@ -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 }} diff --git a/src/functions/public/Get-Greeting.ps1 b/src/functions/public/Get-Greeting.ps1 new file mode 100644 index 0000000..f8f8057 --- /dev/null +++ b/src/functions/public/Get-Greeting.ps1 @@ -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!" +} diff --git a/tests/PSModuleTest.Tests.ps1 b/tests/PSModuleTest.Tests.ps1 index 8258bb7..43f8710 100644 --- a/tests/PSModuleTest.Tests.ps1 +++ b/tests/PSModuleTest.Tests.ps1 @@ -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!' + } }