Skip to content

Initialize Hcl module with placeholder ConvertFrom-Hcl and ConvertTo-Hcl functions #2

@MariusStorhaug

Description

The PSModule/Hcl repository was created from the PSModule template and contains boilerplate placeholder content that is unrelated to the HCL language. The module is intended to provide PowerShell tooling for HashiCorp Configuration Language (HCL), the data language used in Terraform, OpenTofu, and related infrastructure-as-code tooling. Common use cases include parsing .tf configuration files, .tfvars variable files, and locals {} blocks.

Request

Desired capability

The module requires an initial 0.0.1 release to reserve the name on the PowerShell Gallery and establish the correct module structure. The template boilerplate (PSModuleTest, SomethingElse, greet-entity examples) must be removed and replaced with HCL-specific placeholder functions (ConvertFrom-Hcl and ConvertTo-Hcl) that throw NotImplementedException until the full implementation is complete. The README must describe the HCL use case rather than the generic template content.

Acceptance criteria

  • All template boilerplate files are removed from the repository
  • ConvertFrom-Hcl and ConvertTo-Hcl are present as placeholder functions that throw NotImplementedException
  • src/manifest.psd1 specifies ModuleVersion = '0.0.1'
  • README.md describes the HCL module purpose, installation, and usage with HCL-specific examples
  • tests/Hcl.Tests.ps1 contains a simple test verifying each placeholder function throws as expected
  • examples/General.ps1 contains a minimal HCL usage example
  • A pull request targeting main triggers the CI/CD pipeline to publish version 0.0.1 to the PowerShell Gallery

Technical decisions

Placeholder pattern: Follow the established pattern from PSModule/Toml#init — each placeholder function accepts the relevant input parameter, discards it with $null = $InputObject, and throws [System.NotImplementedException] with a descriptive message.

Functions: Two public functions — ConvertFrom-Hcl (HCL string → PowerShell object) and ConvertTo-Hcl (PowerShell object → HCL string). Both are placeholders at this stage.

Version: ModuleVersion = '0.0.1' in src/manifest.psd1. The framework default (0.0.0) is replaced to signal the first publishable release.

Files to remove: All template-generated files: src/functions/public/Test-PSModuleTest.ps1, src/functions/public/completers.ps1, src/functions/public/PSModule/ (directory), src/functions/public/SomethingElse/ (directory), and tests/PSModuleTest.Tests.ps1.

Files to add or update: README.md, src/manifest.psd1, src/functions/public/ConvertFrom-Hcl.ps1, src/functions/public/ConvertTo-Hcl.ps1, tests/Hcl.Tests.ps1, examples/General.ps1.

Branch name: init — consistent with the PSModule/Toml initialization pattern.


Implementation plan

Remove boilerplate

  • Delete src/functions/public/Test-PSModuleTest.ps1
  • Delete src/functions/public/completers.ps1
  • Delete src/functions/public/PSModule/Get-PSModuleTest.ps1
  • Delete src/functions/public/PSModule/New-PSModuleTest.ps1
  • Delete src/functions/public/PSModule/PSModule.md
  • Delete src/functions/public/SomethingElse/Set-PSModuleTest.ps1
  • Delete src/functions/public/SomethingElse/SomethingElse.md
  • Delete tests/PSModuleTest.Tests.ps1

Add HCL-specific content

  • Update README.md with HCL module description, installation, and usage examples
  • Update src/manifest.psd1 to ModuleVersion = '0.0.1'
  • Add src/functions/public/ConvertFrom-Hcl.ps1 placeholder
  • Add src/functions/public/ConvertTo-Hcl.ps1 placeholder
  • Add tests/Hcl.Tests.ps1 with NotImplementedException assertions
  • Update examples/General.ps1 with HCL example

Release

  • Open pull request from init to main to trigger the 0.0.1 publish pipeline

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions