Skip to content

🌟 [Release]: PowerShell-Lua data conversion now available via ConvertTo-Lua and ConvertFrom-Lua#3

Merged
Marius Storhaug (MariusStorhaug) merged 24 commits intomainfrom
init
Apr 16, 2026
Merged

🌟 [Release]: PowerShell-Lua data conversion now available via ConvertTo-Lua and ConvertFrom-Lua#3
Marius Storhaug (MariusStorhaug) merged 24 commits intomainfrom
init

Conversation

@MariusStorhaug
Copy link
Copy Markdown
Member

PowerShell objects can now be serialized to Lua table constructor strings and deserialized back — enabling round-trip data conversion between PowerShell and Lua configuration files. This is useful for managing configuration data in Lua-based applications such as World of Warcraft addons (e.g., ElvUI).

New: ConvertTo-Lua — serialize PowerShell objects to Lua

ConvertTo-Lua converts hashtables, ordered dictionaries, PSCustomObjects, arrays, and primitives into valid Lua table constructor strings per the Lua 5.4 grammar §3.4.9.

@{ name = "ElvUI"; version = "13.74"; enabled = $true } | ConvertTo-Lua
# Output:
# {
#     enabled = true,
#     name = "ElvUI",
#     version = "13.74"
# }

# Compressed output
@(1, 2, 3) | ConvertTo-Lua -Compress
# Output: {1,2,3}

Parameters:

Parameter Description
-InputObject Any PowerShell object (mandatory, accepts pipeline input)
-Depth Max recursion depth (default 2, range 0–100). Warns when exceeded
-Compress Omit whitespace and indentation
-EnumsAsStrings Serialize enum values as string names instead of numeric values
-AsArray Always wrap output in a Lua sequence table, even for a single value

Properties with $null values are omitted from output (per Lua's nil-means-absent semantics). Keys use bare identifiers when valid per Lua grammar; bracket-quote notation otherwise.

New: ConvertFrom-Lua — deserialize Lua table strings to PowerShell objects

ConvertFrom-Lua parses Lua table constructor strings into PSCustomObject by default, or ordered hashtable with -AsHashtable.

'{ server = "localhost", port = 8080 }' | ConvertFrom-Lua
# Output: PSCustomObject with .server and .port properties

# Round-trip fidelity
'{1, 2, 3}' | ConvertFrom-Lua -NoEnumerate | ConvertTo-Lua -Compress
# Output: {1,2,3}

Parameters:

Parameter Description
-InputObject A Lua table constructor string (mandatory, accepts pipeline input)
-AsHashtable Output [ordered] hashtable instead of PSCustomObject
-Depth Max nesting depth allowed in input (default 1024). Throws on violation
-NoEnumerate Output arrays as a single [object[]] without pipeline enumeration

Supported Lua data types: tables (sequence, key-value, mixed, nested, empty), strings (double-quoted, single-quoted, long strings with all escape sequences), numbers (integer, float, hex, scientific notation), booleans, and nil.

Lua comments (single-line -- and multi-line --[[ ]]) are correctly ignored during parsing.

Technical Details

  • Template files removed: All placeholder files from the PSModule template (Book.ps1, SecretWriter.ps1, Get-PSModuleTest.ps1, New-PSModuleTest.ps1, Set-PSModuleTest.ps1, Test-PSModuleTest.ps1, format/type XML files, data files, variables, etc.) replaced with actual module implementation.
  • Public functions: src/functions/public/Lua/ConvertTo-Lua.ps1 and src/functions/public/Lua/ConvertFrom-Lua.ps1 — thin wrappers handling pipeline input, parameter validation, and -AsArray/-NoEnumerate behavior.
  • Private functions: ConvertTo-LuaTable.ps1 (recursive serializer with depth tracking and 4-space indent), ConvertFrom-LuaTable.ps1 (recursive-descent parser with script-scoped state), Format-LuaKey.ps1 (Lua identifier validation against pattern [a-zA-Z_][a-zA-Z0-9_]* and reserved word list).
  • Parser: Pure PowerShell recursive-descent parser — no external DLL or .NET assembly dependency. Tracks nesting depth and throws when -Depth is exceeded.
  • Tests: 1,158 lines of Pester tests in tests/Lua.Tests.ps1 covering all Lua data types, comment handling, reserved words as keys, depth limits, parameter switches, round-trip conversion, and error cases. Test data files in tests/data/ (Lua/JSON pairs) for complex structure validation.
  • README: Updated with module description, installation instructions, and usage examples.
  • 45 files changed, 2,620 insertions, 648 deletions.

- Implemented ConvertTo-Lua and ConvertFrom-Lua functions for converting PowerShell objects to Lua table strings and vice versa.
- Added helper functions ConvertTo-LuaTable and Format-LuaKey for internal processing.
- Created comprehensive tests for both conversion functions, covering various data types including primitives, strings, arrays, and tables.
- Included test data files for validation of string and array conversions.
- Ensured proper handling of comments and special characters in Lua syntax.
Bumps [PSModule/Process-PSModule/.github/workflows/workflow.yml](https://github.com/psmodule/process-psmodule) from 5.4.3 to 5.4.7.
- [Release notes](https://github.com/psmodule/process-psmodule/releases)
- [Commits](PSModule/Process-PSModule@60bdf8a...1111791)

---
updated-dependencies:
- dependency-name: PSModule/Process-PSModule/.github/workflows/workflow.yml
  dependency-version: 5.4.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

Super-linter summary

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

Super-linter detected linting errors

For more information, see the GitHub Actions workflow run

Powered by Super-linter

LUA
Checking /github/workspace/tests/data/Strings.lua �[0m�[1m1 error�[0m

    /github/workspace/tests/data/Strings.lua:1:1: expected statement near '{'

Checking /github/workspace/tests/data/TestStructure.lua �[0m�[1m1 error�[0m

    /github/workspace/tests/data/TestStructure.lua:1:1: expected statement near '{'

Checking /github/workspace/tests/data/Arrays.lua  �[0m�[1m1 error�[0m

    /github/workspace/tests/data/Arrays.lua:1:1: expected statement near '{'

Checking /github/workspace/tests/data/DeepStructure.lua �[0m�[1m1 error�[0m

    /github/workspace/tests/data/DeepStructure.lua:1:1: expected statement near '{'

Total: �[0m�[0m�[1m0�[0m warnings / �[0m�[31m�[1m4�[0m errors in 4 files
POWERSHELL

�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseCmdletCorrectly                Warning      ConvertFro 86    Cmdlet 'Write
                                                 m-Lua.ps1        -Output' may
                                                                  be used incor
                                                                  rectly. Pleas
                                                                  e check that
                                                                  all mandatory
                                                                   parameters a
                                                                  re supplied.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSAlignAssignmentStatement          Warning      Lua.Tests. 1009  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1013  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1108  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1109  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1134  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1135  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1141  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1142  Assignment st
                                                 ps1              atements are
                                                                  not aligned


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSAvoidLongLines                    Warning      ConvertFro 152   Line exceeds
                                                 m-LuaTable       the configure
                                                 .ps1             d maximum len
                                                                  gth of 150 ch
                                                                  aracters
PSAvoidLongLines                    Warning      ConvertFro 546   Line exceeds
                                                 m-LuaTable       the configure
                                                 .ps1             d maximum len
                                                                  gth of 150 ch
                                                                  aracters
PSAvoidLongLines                    Warning      ConvertFro 561   Line exceeds
                                                 m-LuaTable       the configure
                                                 .ps1             d maximum len
                                                                  gth of 150 ch
                                                                  aracters
PSUseOutputTypeCorrectly            Information  ConvertFro 165   The cmdlet 'R
                                                 m-LuaTable       ead-LuaValue'
                                                 .ps1              returns an o
                                                                  bject of type
                                                                   'System.Bool
                                                                  ean' but this
                                                                   type is not
                                                                  declared in t
                                                                  he OutputType
                                                                   attribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 166   The cmdlet 'R
                                                 m-LuaTable       ead-LuaValue'
                                                 .ps1              returns an o
                                                                  bject of type
                                                                   'System.Bool
                                                                  ean' but this
                                                                   type is not
                                                                  declared in t
                                                                  he OutputType
                                                                   attribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 402   The cmdlet 'R
                                                 m-LuaTable       ead-LuaNumber
                                                 .ps1             ' returns an
                                                                  object of typ
                                                                  e 'System.Dou
                                                                  ble' but this
                                                                   type is not
                                                                  declared in t
                                                                  he OutputType
                                                                   attribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 404   The cmdlet 'R
                                                 m-LuaTable       ead-LuaNumber
                                                 .ps1             ' returns an
                                                                  object of typ
                                                                  e 'System.Dou
                                                                  ble' but this
                                                                   type is not
                                                                  declared in t
                                                                  he OutputType
                                                                   attribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 412   The cmdlet 'R
                                                 m-LuaTable       ead-LuaNumber
                                                 .ps1             ' returns an
                                                                  object of typ
                                                                  e 'System.Int
                                                                  32' but this
                                                                  type is not d
                                                                  eclared in th
                                                                  e OutputType
                                                                  attribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 419   The cmdlet 'R
                                                 m-LuaTable       ead-LuaNumber
                                                 .ps1             ' returns an
                                                                  object of typ
                                                                  e 'System.Int
                                                                  32' but this
                                                                  type is not d
                                                                  eclared in th
                                                                  e OutputType
                                                                  attribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 421   The cmdlet 'R
                                                 m-LuaTable       ead-LuaNumber
                                                 .ps1             ' returns an
                                                                  object of typ
                                                                  e 'System.Int
                                                                  64' but this
                                                                  type is not d
                                                                  eclared in th
                                                                  e OutputType
                                                                  attribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 423   The cmdlet 'R
                                                 m-LuaTable       ead-LuaNumber
                                                 .ps1             ' returns an
                                                                  object of typ
                                                                  e 'System.Dou
                                                                  ble' but this
                                                                   type is not
                                                                  declared in t
                                                                  he OutputType
                                                                   attribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 574   The cmdlet 'R
                                                 m-LuaTable       ead-LuaTable'
                                                 .ps1              returns an o
                                                                  bject of type
                                                                   'System.Obje
                                                                  ct[]' but thi
                                                                  s type is not
                                                                   declared in
                                                                  the OutputTyp
                                                                  e attribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 582   The cmdlet 'R
                                                 m-LuaTable       ead-LuaTable'
                                                 .ps1              returns an o
                                                                  bject of type
                                                                   'System.Coll
                                                                  ections.Speci
                                                                  alized.Ordere
                                                                  dDictionary'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSUseOutputTypeCorrectly            Information  ConvertFro 600   The cmdlet 'R
                                                 m-LuaTable       ead-LuaTable'
                                                 .ps1              returns an o
                                                                  bject of type
                                                                   'System.Coll
                                                                  ections.Speci
                                                                  alized.Ordere
                                                                  dDictionary'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSUseConsistentWhitespace           Warning      ConvertFro 410   Use space bef
                                                 m-LuaTable       ore and after
                                                 .ps1              binary and a
                                                                  ssignment ope
                                                                  rators.
PSUseConsistentWhitespace           Warning      ConvertFro 458   Use space bef
                                                 m-LuaTable       ore and after
                                                 .ps1              binary and a
                                                                  ssignment ope
                                                                  rators.
PSUseConsistentWhitespace           Warning      ConvertFro 463   Use space bef
                                                 m-LuaTable       ore and after
                                                 .ps1              binary and a
                                                                  ssignment ope
                                                                  rators.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSAvoidLongLines                    Warning      ConvertTo- 81    Line exceeds
                                                 LuaTable.p       the configure
                                                 s1               d maximum len
                                                                  gth of 150 ch
                                                                  aracters
PSAvoidLongLines                    Warning      ConvertTo- 98    Line exceeds
                                                 LuaTable.p       the configure
                                                 s1               d maximum len
                                                                  gth of 150 ch
                                                                  aracters
PSAvoidLongLines                    Warning      ConvertTo- 116   Line exceeds
                                                 LuaTable.p       the configure
                                                 s1               d maximum len
                                                                  gth of 150 ch
                                                                  aracters
PSAvoidLongLines                    Warning      ConvertTo- 139   Line exceeds
                                                 LuaTable.p       the configure
                                                 s1               d maximum len
                                                                  gth of 150 ch
                                                                  aracters
SPELL_CODESPELL
/github/workspace/tests/data/TestStructure.json:11: Simpy ==> Simply
/github/workspace/tests/data/TestStructure.lua:11: Simpy ==> Simply

- Improved string escaping in ConvertTo-LuaTable for better handling of special characters.
- Enhanced depth warning messages for better clarity.
- Simplified parameter passing in ConvertTo-LuaTable calls.
- Updated ConvertFrom-Lua to use array syntax for output.
- Refactored ConvertTo-Lua to improve readability and maintainability.
- Removed obsolete header and manifest files.
- Updated tests for better clarity and consistency.
- Added new Lua parsing functions: Read-LuaHexFloat, Read-LuaMultiLineString, Read-LuaNumber, Read-LuaString, Read-LuaTable, Read-LuaValue, and Skip-LuaWhitespace for comprehensive Lua support.
- Adjusted data files to conform to new structure and formatting.
@github-actions
Copy link
Copy Markdown

Super-linter summary

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

Super-linter detected linting errors

For more information, see the GitHub Actions workflow run

Powered by Super-linter

POWERSHELL

�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseConsistentWhitespace           Warning      Read-LuaNu 109   Use space bef
                                                 mber.ps1         ore and after
                                                                   binary and a
                                                                  ssignment ope
                                                                  rators.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseConsistentIndentation          Warning      Read-LuaVa 51    Indentation n
                                                 lue.ps1          ot consistent
PSUseConsistentIndentation          Warning      Read-LuaVa 52    Indentation n
                                                 lue.ps1          ot consistent


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseOutputTypeCorrectly            Information  ConvertFro 86    The cmdlet 'C
                                                 m-Lua.ps1        onvertFrom-Lu
                                                                  a' returns an
                                                                   object of ty
                                                                  pe 'System.Ar
                                                                  ray' but this
                                                                   type is not
                                                                  declared in t
                                                                  he OutputType
                                                                   attribute.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSAlignAssignmentStatement          Warning      Lua.Tests. 1008  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1009  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1012  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1013  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1015  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1018  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1023  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1107  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1108  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1121  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1122  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1133  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1140  Assignment st
                                                 ps1              atements are
                                                                  not aligned


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseConsistentWhitespace           Warning      Read-LuaHe 51    Use space bef
                                                 xFloat.ps1       ore and after
                                                                   binary and a
                                                                  ssignment ope
                                                                  rators.

@github-actions
Copy link
Copy Markdown

Super-linter summary

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

Super-linter detected linting errors

For more information, see the GitHub Actions workflow run

Powered by Super-linter

POWERSHELL

�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSAlignAssignmentStatement          Warning      Lua.Tests. 1008  Assignment st
                                                 ps1              atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      Lua.Tests. 1012  Assignment st
                                                 ps1              atements are
                                                                  not aligned

@github-actions
Copy link
Copy Markdown

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
JSON Pass ✅
LUA 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

@github-actions
Copy link
Copy Markdown

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
JSON Pass ✅
LUA 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

Adds PowerShell ↔ Lua table constructor round-trip conversion to the module (serializer + parser), replacing the previous PSModule template scaffolding with a real Lua-focused implementation, tests, and docs.

Changes:

  • Introduces ConvertTo-Lua/ConvertFrom-Lua public cmdlets with private serializer/parser helpers.
  • Adds extensive Pester coverage plus Lua/JSON fixture data for validation and round-trips.
  • Removes template/demo files and updates README/examples + CI workflow reference.

Reviewed changes

Copilot reviewed 54 out of 55 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
tests/data/TestStructure.lua Adds Lua fixture representing a config-like nested table.
tests/data/TestStructure.json Adds JSON reference for TestStructure.lua fixture validation.
tests/data/Strings.lua Adds Lua string-escape fixture data.
tests/data/Strings.json Adds JSON reference for string-escape fixture data.
tests/data/DeepStructure.lua Adds deep-nesting Lua fixture for depth/structure validation.
tests/data/DeepStructure.json Adds JSON reference for deep-nesting fixture validation.
tests/data/Arrays.lua Adds Lua array/sequence fixture data.
tests/data/Arrays.json Adds JSON reference for arrays fixture data.
tests/PSModuleTest.Tests.ps1 Removes template Pester tests for placeholder functions.
tests/Lua.Tests.ps1 Adds comprehensive Pester tests for Lua parsing/serialization + round-trips.
src/variables/public/SolarSystems.ps1 Removes template variable content.
src/variables/public/Planets.ps1 Removes template variable content.
src/variables/public/Moons.ps1 Removes template variable content.
src/variables/private/PrivateVariables.ps1 Removes template private variables.
src/types/FileInfo.Types.ps1xml Removes template type extension.
src/types/DirectoryInfo.Types.ps1xml Removes template type extensions.
src/scripts/loader.ps1 Removes template loader script.
src/modules/OtherPSModule.psm1 Removes placeholder module code.
src/manifest.psd1 Removes template manifest override file.
src/init/initializer.ps1 Removes template initializer script.
src/header.ps1 Removes template header script.
src/functions/public/completers.ps1 Removes template argument completer.
src/functions/public/Test-PSModuleTest.ps1 Removes placeholder public function.
src/functions/public/SomethingElse/SomethingElse.md Removes template docs page.
src/functions/public/SomethingElse/Set-PSModuleTest.ps1 Removes placeholder function.
src/functions/public/PSModule/PSModule.md Removes template docs page.
src/functions/public/PSModule/New-PSModuleTest.ps1 Removes placeholder public function.
src/functions/public/PSModule/Get-PSModuleTest.ps1 Removes placeholder public function.
src/functions/public/Lua/ConvertTo-Lua.ps1 Adds public serializer wrapper cmdlet.
src/functions/public/Lua/ConvertFrom-Lua.ps1 Adds public parser wrapper cmdlet.
src/functions/private/Skip-LuaWhitespace.ps1 Adds parser helper to skip whitespace/comments.
src/functions/private/Read-LuaValue.ps1 Adds value-dispatch for parser (tables/strings/numbers/keywords).
src/functions/private/Read-LuaTable.ps1 Adds table constructor parsing logic (sequence/key-value/mixed).
src/functions/private/Read-LuaString.ps1 Adds quoted string parsing with escape handling.
src/functions/private/Read-LuaNumber.ps1 Adds number parsing (int/float/hex/scientific/hex-float).
src/functions/private/Read-LuaMultiLineString.ps1 Adds [[...]] multiline string parsing helper.
src/functions/private/Read-LuaHexFloat.ps1 Adds hex-float parsing helper (e.g. 0x1.fp10).
src/functions/private/Format-LuaKey.ps1 Adds key formatting (bare identifier vs ["..."]) for serialization.
src/functions/private/ConvertTo-LuaTable.ps1 Adds recursive serializer implementation with depth/compress options.
src/functions/private/ConvertFrom-LuaTable.ps1 Adds top-level parse entrypoint with optional leading return.
src/formats/Mygciview.Format.ps1xml Removes template format view.
src/formats/CultureInfo.Format.ps1xml Removes template format view.
src/finally.ps1 Removes template final loader script.
src/data/Settings.psd1 Removes template data file.
src/data/Config.psd1 Removes template data file.
src/classes/public/Book.ps1 Removes template demo classes.
src/classes/private/SecretWriter.ps1 Removes template demo class.
src/README.md Removes template README under src/.
examples/General.ps1 Updates examples to demonstrate Lua conversion cmdlets.
README.md Replaces template README with module-focused documentation and examples.
.github/workflows/Process-PSModule.yml Bumps referenced Process-PSModule workflow version.
.github/linters/.codespellrc Updates codespell ignore list for test data terms.

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

Comment thread src/functions/private/ConvertTo-LuaTable.ps1
Comment thread src/functions/private/ConvertFrom-LuaTable.ps1
Comment thread src/functions/private/Read-LuaString.ps1
Comment thread examples/General.ps1 Outdated
Comment thread README.md Outdated
Comment thread src/functions/private/Read-LuaTable.ps1 Outdated
Comment thread src/functions/private/Read-LuaTable.ps1 Outdated
Comment thread src/functions/private/Read-LuaValue.ps1 Outdated
Comment thread src/functions/private/Read-LuaMultiLineString.ps1 Outdated
Comment thread src/functions/public/Lua/ConvertFrom-Lua.ps1
@github-actions
Copy link
Copy Markdown

✅ New prerelease: PowerShell Gallery - Lua 0.1.0-init001

@github-actions
Copy link
Copy Markdown

✅ New prerelease: GitHub - Lua v0.1.0-init001

@github-actions
Copy link
Copy Markdown

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
JSON Pass ✅
LUA 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

@github-actions
Copy link
Copy Markdown

✅ New prerelease: PowerShell Gallery - Lua 0.1.0-init002

@github-actions
Copy link
Copy Markdown

✅ New prerelease: GitHub - Lua v0.1.0-init002

Copilot AI review requested due to automatic review settings April 13, 2026 22:41
@github-actions
Copy link
Copy Markdown

Super-linter summary

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

Super-linter detected linting errors

For more information, see the GitHub Actions workflow run

Powered by Super-linter

LUA
Checking /github/workspace/tests/data/Arrays.lua  �[0m�[32m�[1mOK�[0m
Checking /github/workspace/tests/data/Assignments.lua �[0m�[31m�[1m2 warnings�[0m

    /github/workspace/tests/data/Assignments.lua:1:1: setting non-standard global variable �[0m�[1mMyAddonDB�[0m
    /github/workspace/tests/data/Assignments.lua:6:1: setting non-standard global variable �[0m�[1mMyAddonOptions�[0m

Checking /github/workspace/tests/data/DeepStructure.lua �[0m�[32m�[1mOK�[0m
Checking /github/workspace/tests/data/Strings.lua �[0m�[32m�[1mOK�[0m
Checking /github/workspace/tests/data/TestStructure.lua �[0m�[32m�[1mOK�[0m
Checking /github/workspace/tests/data/WoWSavedVariables.lua �[0m�[31m�[1m2 warnings�[0m

    /github/workspace/tests/data/WoWSavedVariables.lua:1:1: setting non-standard global variable �[0m�[1mWildDB�[0m
    /github/workspace/tests/data/WoWSavedVariables.lua:79:1: setting non-standard global variable �[0m�[1mWildDBOptions�[0m

Total: �[0m�[31m�[1m4�[0m warnings / �[0m�[0m�[1m0�[0m errors in 6 files
POWERSHELL

�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseOutputTypeCorrectly            Information  ConvertFro 120   The cmdlet 'C
                                                 m-LuaTable       onvertFrom-Lu
                                                 .ps1             aTable' retur
                                                                  ns an object
                                                                  of type 'Syst
                                                                  em.Collection
                                                                  s.Specialized
                                                                  .OrderedDicti
                                                                  onary' but th
                                                                  is type is no
                                                                  t declared in
                                                                   the OutputTy
                                                                  pe attribute.

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 58 out of 59 changed files in this pull request and generated 3 comments.


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

Comment thread src/functions/private/ConvertTo-LuaTable.ps1 Outdated
Comment thread src/functions/private/ConvertFrom-LuaTable.ps1
Comment thread src/functions/private/Read-LuaTable.ps1 Outdated
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 59 out of 60 changed files in this pull request and generated 2 comments.


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

Comment thread src/functions/private/ConvertFrom-LuaTable.ps1
Comment thread src/functions/private/ConvertFrom-LuaTable.ps1 Outdated
- Assignment parser now accepts semicolons between statements (A = 1; B = 2)
- Assignment-detection lookahead uses Skip-LuaWhitespace to handle comments between identifier and '='
- Added tests for both scenarios
@github-actions
Copy link
Copy Markdown

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
JSON Pass ✅
LUA 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 59 out of 60 changed files in this pull request and generated 1 comment.


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

Comment thread src/functions/private/Read-LuaValue.ps1 Outdated
@github-actions
Copy link
Copy Markdown

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
JSON Pass ✅
LUA 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 59 out of 60 changed files in this pull request and generated 2 comments.


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

Comment thread src/functions/public/Lua/ConvertFrom-Lua.ps1 Outdated
Comment thread src/functions/private/Skip-LuaWhitespace.ps1 Outdated
@github-actions
Copy link
Copy Markdown

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
JSON Pass ✅
LUA 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 59 out of 60 changed files in this pull request and generated 3 comments.


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

Comment thread tests/Lua.Tests.ps1
Comment thread tests/Lua.Tests.ps1
Comment thread tests/Lua.Tests.ps1
@github-actions
Copy link
Copy Markdown

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
JSON Pass ✅
LUA 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 59 out of 60 changed files in this pull request and generated 3 comments.


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

Comment thread src/functions/private/Read-LuaTable.ps1
Comment thread src/functions/private/ConvertFrom-LuaTable.ps1
Comment thread src/functions/private/ConvertTo-LuaTable.ps1
@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title 🚀 [Minor]: PowerShell-Lua data conversion now available via ConvertTo-Lua and ConvertFrom-Lua 🌟 [Release]: PowerShell-Lua data conversion now available via ConvertTo-Lua and ConvertFrom-Lua Apr 15, 2026
Bumps [PSModule/Process-PSModule/.github/workflows/workflow.yml](https://github.com/psmodule/process-psmodule) from 5.4.3 to 5.4.7.
- [Release notes](https://github.com/psmodule/process-psmodule/releases)
- [Commits](PSModule/Process-PSModule@60bdf8a...1111791)

---
updated-dependencies:
- dependency-name: PSModule/Process-PSModule/.github/workflows/workflow.yml
  dependency-version: 5.4.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
JSON Pass ✅
LUA 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) merged commit e070ac5 into main Apr 16, 2026
39 checks passed
@github-actions
Copy link
Copy Markdown

✅ New release: PowerShell Gallery - Lua 1.0.0

@github-actions
Copy link
Copy Markdown

✅ New release: GitHub - Lua v1.0.0

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ConvertTo-Lua and ConvertFrom-Lua for PowerShell-Lua data conversion

2 participants