Skip to content

🩹 [Patch]: Initialize Hcl module#3

Merged
Marius Storhaug (MariusStorhaug) merged 11 commits intomainfrom
init
May 3, 2026
Merged

🩹 [Patch]: Initialize Hcl module#3
Marius Storhaug (MariusStorhaug) merged 11 commits intomainfrom
init

Conversation

@MariusStorhaug
Copy link
Copy Markdown
Member

@MariusStorhaug Marius Storhaug (MariusStorhaug) commented May 3, 2026

The Hcl module is now available on the PowerShell Gallery as version 0.0.1. This initial release reserves the module name and establishes the intended API surface — ConvertFrom-Hcl and ConvertTo-Hcl — for working with HashiCorp Configuration Language as used in Terraform, OpenTofu, and related infrastructure-as-code tooling. Both functions are placeholders that throw NotImplementedException until the full parser and serializer are implemented.

New: Hcl module on the PowerShell Gallery

The module can be installed from the PowerShell Gallery:

Install-PSResource -Name Hcl
Import-Module -Name Hcl

ConvertFrom-Hcl and ConvertTo-Hcl are available as commands but throw NotImplementedException until the implementation is complete. Their presence reserves the intended API and allows downstream tooling to take a dependency on the module name.

Technical Details

  • All template boilerplate removed: Test-PSModuleTest.ps1, completers.ps1, PSModule/ and SomethingElse/ subdirectories, and tests/PSModuleTest.Tests.ps1.
  • ConvertFrom-Hcl and ConvertTo-Hcl added as public placeholder functions, following the same pattern as PSModule/Toml#init.
  • src/manifest.psd1 set to ModuleVersion = '0.0.1' to trigger the first publish pipeline run.
  • tests/Hcl.Tests.ps1 added with assertions that both placeholders throw as expected.
  • examples/General.ps1 and README.md updated with HCL-specific content (Terraform locals, .tfvars examples).

Copilot AI review requested due to automatic review settings May 3, 2026 10:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Initializes the Hcl PowerShell module for an initial 0.0.1 publish by replacing template content with HCL-specific placeholders and updating docs/examples to match the intended Terraform/OpenTofu use cases.

Changes:

  • Added placeholder public functions ConvertFrom-Hcl and ConvertTo-Hcl that throw System.NotImplementedException.
  • Added Pester tests for the placeholder functions and removed template test/boilerplate public functions.
  • Updated module version to 0.0.1 and replaced README/examples with HCL-focused content.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/PSModuleTest.Tests.ps1 Removed template “Hello, World!” tests.
tests/Hcl.Tests.ps1 Added Pester tests for new placeholder HCL functions.
src/manifest.psd1 Bumped ModuleVersion to 0.0.1.
src/functions/public/completers.ps1 Removed template argument completer.
src/functions/public/Test-PSModuleTest.ps1 Removed template public function.
src/functions/public/SomethingElse/SomethingElse.md Removed template docs file.
src/functions/public/SomethingElse/Set-PSModuleTest.ps1 Removed template public function.
src/functions/public/PSModule/PSModule.md Removed template docs file.
src/functions/public/PSModule/New-PSModuleTest.ps1 Removed template public function.
src/functions/public/PSModule/Get-PSModuleTest.ps1 Removed template public function.
src/functions/public/ConvertTo-Hcl.ps1 Added ConvertTo-Hcl placeholder (throws).
src/functions/public/ConvertFrom-Hcl.ps1 Added ConvertFrom-Hcl placeholder (throws).
examples/General.ps1 Replaced template example with an HCL-focused example.
README.md Replaced template README with HCL module description and examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
Comment on lines +23 to +38
### Example 1: Parse a Terraform locals block

```powershell
Greet-Entity -Name 'World'
Hello, World!
$hcl = @'
locals {
environment = "production"
region = "us-east-1"
tags = {
project = "myapp"
team = "platform"
}
}
'@
$result = ConvertFrom-Hcl -InputObject $hcl
$result.locals.environment # production
$result.locals.tags.project # myapp
Comment thread examples/General.ps1
region = "us-east-1"
}
'@
ConvertFrom-Hcl -InputObject $hcl
Comment thread README.md
Comment on lines +1 to +3
# Hcl

{{ DESCRIPTION }}
A PowerShell module for working with [HashiCorp Configuration Language (HCL)](https://github.com/hashicorp/hcl), as used in [Terraform](https://www.terraform.io/), [OpenTofu](https://opentofu.org/), and other infrastructure-as-code tools. Supports parsing `.tf` configuration files, `.tfvars` variable files, `locals {}` blocks, and converting PowerShell objects back to HCL format.
Comment thread tests/Hcl.Tests.ps1
Comment on lines +14 to +17
{ ConvertFrom-Hcl -InputObject 'locals { }' } | Should -Throw
}
It 'Function: ConvertTo-Hcl - Throws NotImplementedException' {
{ ConvertTo-Hcl -InputObject @{} } | Should -Throw
…e/Process-PSModule/dot-github/workflows/workflow.yml-5.5.0

Bump PSModule/Process-PSModule/.github/workflows/workflow.yml from 5.4.3 to 5.5.0
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title 🚀 [Init]: Initialize Hcl module with placeholder functions (0.0.1 release) 🩹 [Patch]: Initialize Hcl module with placeholder functions (0.0.1 release) May 3, 2026
Copilot AI review requested due to automatic review settings May 3, 2026 12:59
@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title 🩹 [Patch]: Initialize Hcl module with placeholder functions (0.0.1 release) 🩹 [Patch]: Initialize Hcl module May 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 35 out of 36 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/Hcl.Tests.ps1
Comment on lines +13 to +18
It 'Function: ConvertFrom-Hcl - Throws NotImplementedException' {
{ ConvertFrom-Hcl -InputObject 'locals { }' } | Should -Throw
}
It 'Function: ConvertTo-Hcl - Throws NotImplementedException' {
{ ConvertTo-Hcl -InputObject @{} } | Should -Throw
}
Comment thread README.md
# Hcl

{{ DESCRIPTION }}
A PowerShell module for working with [HashiCorp Configuration Language (HCL)](https://github.com/hashicorp/hcl), as used in [Terraform](https://www.terraform.io/), [OpenTofu](https://opentofu.org/), and other infrastructure-as-code tools. Supports parsing `.tf` configuration files, `.tfvars` variable files, `locals {}` blocks, and converting PowerShell objects back to HCL format.
Comment thread README.md
Comment on lines +36 to +38
$result = ConvertFrom-Hcl -InputObject $hcl
$result.locals.environment # production
$result.locals.tags.project # myapp
Comment thread examples/General.ps1
region = "us-east-1"
}
'@
ConvertFrom-Hcl -InputObject $hcl
Comment on lines +19 to +23
[Parameter(Mandatory)]
[string] $InputObject
)
$null = $InputObject
throw [System.NotImplementedException] 'ConvertFrom-Hcl is not yet implemented.'
Comment on lines 29 to 31
Process-PSModule:
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@60bdf8a5a4c92c53fcf2a8d23f7d5f5c93e6864e # v5.4.3
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@11117919e65242d3388727819a751f74ad24ea9e # v5.5.0
secrets:
@MariusStorhaug Marius Storhaug (MariusStorhaug) merged commit aa15ae1 into main May 3, 2026
41 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

✅ New release: PowerShell Gallery - Hcl 0.0.1

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

✅ New release: GitHub - Hcl v0.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants