From 6b0f863ab5ff9b24b1b383159181dee68f079fd4 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 17 Jan 2026 22:44:38 +0100 Subject: [PATCH 1/2] Update Process-PSModule workflow reference and enhance Get-Greeting function with additional test cases --- .github/workflows/Process-PSModule.yml | 2 +- src/functions/public/Get-Greeting.ps1 | 22 ++++++++++++++++++++++ tests/PSModuleTest.Tests.ps1 | 8 ++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/functions/public/Get-Greeting.ps1 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..8909cb8 --- /dev/null +++ b/src/functions/public/Get-Greeting.ps1 @@ -0,0 +1,22 @@ +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!" + #> + [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!' + } } From bcafd6edbf00d89d48c1eb84cfc76026463bd04c Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 17 Jan 2026 22:51:44 +0100 Subject: [PATCH 2/2] Add OutputType attribute to Get-Greeting --- src/functions/public/Get-Greeting.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/functions/public/Get-Greeting.ps1 b/src/functions/public/Get-Greeting.ps1 index 8909cb8..f8f8057 100644 --- a/src/functions/public/Get-Greeting.ps1 +++ b/src/functions/public/Get-Greeting.ps1 @@ -11,6 +11,7 @@ Returns "Good Morning!" #> + [OutputType([string])] [CmdletBinding()] param ( # The time of day for the greeting.