diff --git a/.github/workflows/Process-PSModule.yml b/.github/workflows/Process-PSModule.yml index aebc8ed..75a426b 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@fb1bdb8fefd243292f779d2a856a38db6fe6daf4 # v6.1.13 + uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@1653be8d36607d9535f600278c44789979477813 # v6.1.16 secrets: APIKey: ${{ secrets.APIKEY }} diff --git a/README.md b/README.md index 9cfd27d..8aedc5f 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,6 @@ -# Template-PSModule +# Yml -The canonical starting template for new PowerShell modules in the PSModule organization. - -## Purpose - -Use this template when creating a new PowerShell module repository. -It provides the CI/CD framework wiring, required community files, and starter layout that every PSModule module repository needs. - -For step-by-step instructions, see the [template quickstart](https://psmodule.github.io/docs/Modules/Process-PSModule/template-quickstart/). - -## After creating a repository from this template - -1. Replace the `{{ NAME }}` placeholder with your module name throughout the repository. -2. Replace the starter function, test, and example with your module's first real command. -3. Set the repository description and custom properties on GitHub. -4. Confirm `.github/PSModule.yml` only overrides defaults when your module needs different behavior. -5. Open a draft pull request and run the full CI pipeline. - -See [repository defaults](https://psmodule.github.io/docs/Modules/Repository-Defaults/) for the full checklist. +A PowerShell module for working with YAML files and data. ## Prerequisites @@ -25,5 +8,5 @@ Modules built from this template use the [PSModule framework](https://github.com ## Contributing -To contribute to this template itself, read the [Contribution guidelines](CONTRIBUTING.md). +Read the [Contribution guidelines](CONTRIBUTING.md). For agents and AI tools, start with [`AGENTS.md`](AGENTS.md). diff --git a/examples/General.ps1 b/examples/General.ps1 index 79d4f26..672d81d 100644 --- a/examples/General.ps1 +++ b/examples/General.ps1 @@ -3,5 +3,5 @@ Basic module usage example. #> -Import-Module -Name '{{ NAME }}' -Get-PSModuleTest -Name 'World' +Import-Module -Name 'Yml' +ConvertTo-Yml -InputObject @{ Name = 'World' } diff --git a/src/functions/public/ConvertTo-Yml.ps1 b/src/functions/public/ConvertTo-Yml.ps1 new file mode 100644 index 0000000..22d82b0 --- /dev/null +++ b/src/functions/public/ConvertTo-Yml.ps1 @@ -0,0 +1,39 @@ +function ConvertTo-Yml { + <# + .SYNOPSIS + Converts a PowerShell object to a YAML string. + + .DESCRIPTION + Converts a PowerShell object to a YAML-formatted string. + This is a placeholder function. Full implementation is pending. + + .LINK + https://psmodule.io/Yml/Functions/ConvertTo-Yml/ + + .EXAMPLE + ConvertTo-Yml -InputObject @{ Name = 'World' } + + Name: World + + .INPUTS + System.Object + + You can pipe any object to this function. + + .OUTPUTS + System.String + + A YAML-formatted string representation of the input object. + #> + [OutputType([string])] + [CmdletBinding()] + param ( + # The object to convert to YAML. + [Parameter(Mandatory, ValueFromPipeline)] + [object] $InputObject + ) + process { + $null = $InputObject + throw [System.NotImplementedException] 'ConvertTo-Yml is not yet implemented.' + } +} diff --git a/src/functions/public/Get-PSModuleTest.ps1 b/src/functions/public/Get-PSModuleTest.ps1 deleted file mode 100644 index 3043abd..0000000 --- a/src/functions/public/Get-PSModuleTest.ps1 +++ /dev/null @@ -1,33 +0,0 @@ -function Get-PSModuleTest { - <# - .SYNOPSIS - Greets an entity by name. - - .DESCRIPTION - Returns a greeting string for the given name. - This is a scaffold example function. Replace it with your module's first real command. - - .EXAMPLE - Get-PSModuleTest -Name 'World' - - Hello, World! - - .INPUTS - None - - You cannot pipe objects to this function. - - .OUTPUTS - System.String - - A greeting string for the given name. - #> - [OutputType([string])] - [CmdletBinding()] - param ( - # The name of the entity to greet. - [Parameter(Mandatory)] - [string] $Name - ) - "Hello, $Name!" -} diff --git a/tests/PSModuleTest.Tests.ps1 b/tests/Yml.Tests.ps1 similarity index 74% rename from tests/PSModuleTest.Tests.ps1 rename to tests/Yml.Tests.ps1 index ff69bb3..61cc240 100644 --- a/tests/PSModuleTest.Tests.ps1 +++ b/tests/Yml.Tests.ps1 @@ -12,7 +12,7 @@ param() Describe 'Module' { - It 'Function: Get-PSModuleTest' { - Get-PSModuleTest -Name 'World' | Should -Be 'Hello, World!' + It 'Function: ConvertTo-Yml - is a placeholder and throws NotImplementedException' { + { ConvertTo-Yml -InputObject @{} } | Should -Throw } }