{"id":13706507,"url":"https://github.com/SeeminglyScience/PSStringTemplate","last_synced_at":"2025-05-05T20:31:47.885Z","repository":{"id":87373546,"uuid":"91177940","full_name":"SeeminglyScience/PSStringTemplate","owner":"SeeminglyScience","description":"Create and render templates using the StringTemplate template engine.","archived":false,"fork":false,"pushed_at":"2017-11-11T19:00:17.000Z","size":76,"stargazers_count":11,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T06:11:19.269Z","etag":null,"topics":["code-generation","powershell","template"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SeeminglyScience.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-05-13T13:57:15.000Z","updated_at":"2024-02-22T17:19:01.000Z","dependencies_parsed_at":"2023-03-27T13:03:54.245Z","dependency_job_id":null,"html_url":"https://github.com/SeeminglyScience/PSStringTemplate","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeeminglyScience%2FPSStringTemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeeminglyScience%2FPSStringTemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeeminglyScience%2FPSStringTemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeeminglyScience%2FPSStringTemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SeeminglyScience","download_url":"https://codeload.github.com/SeeminglyScience/PSStringTemplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252571148,"owners_count":21769785,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-generation","powershell","template"],"created_at":"2024-08-02T22:00:58.459Z","updated_at":"2025-05-05T20:31:47.420Z","avatar_url":"https://github.com/SeeminglyScience.png","language":"C#","funding_links":[],"categories":["C# #"],"sub_categories":[],"readme":"# PSStringTemplate\n\nThe PSStringTemplate module provides a PowerShell friendly interface for creating templates using the\n[StringTemplate4](https://github.com/antlr/antlrcs) template engine.\n\nThis project adheres to the Contributor Covenant [code of conduct](https://github.com/SeeminglyScience/PSStringTemplate/tree/master/docs/CODE_OF_CONDUCT.md).\nBy participating, you are expected to uphold this code. Please report unacceptable behavior to seeminglyscience@gmail.com.\n\n## Build Status\n\n|AppVeyor (Windows)|CircleCI (Linux)|CodeCov|\n|---|---|---|\n|[![Build status](https://ci.appveyor.com/api/projects/status/3uvr9oq297uhvj8p?svg=true)](https://ci.appveyor.com/project/SeeminglyScience/psstringtemplate)|[![CircleCI](https://circleci.com/gh/SeeminglyScience/PSStringTemplate.svg?style=svg)](https://circleci.com/gh/SeeminglyScience/PSStringTemplate)|[![codecov](https://codecov.io/gh/SeeminglyScience/PSStringTemplate/branch/master/graph/badge.svg)](https://codecov.io/gh/SeeminglyScience/PSStringTemplate)|\n\n## Documentation\n\nCheck out our **[documentation](https://github.com/SeeminglyScience/PSStringTemplate/tree/master/docs/en-US/PSStringTemplate.md)** for information about how to use this project. For more details on the template definition syntax specifically see the documentation for the [StringTemplate4 project](https://github.com/antlr/stringtemplate4/blob/master/doc/index.md).\n\n## Installation\n\n### Gallery\n\n```powershell\nInstall-Module PSStringTemplate -Scope CurrentUser\n```\n\n### Source\n\n```powershell\ngit clone 'https://github.com/SeeminglyScience/PSStringTemplate.git'\nSet-Location ./PSStringTemplate\nInstall-Module platyPS, Pester, InvokeBuild -Force\nImport-Module platyPS, Pester, InvokeBuild\nInvoke-Build -Task Install\n```\n\n## Usage\n\n### Anonymous template with dictionary parameters\n\n```powershell\nInvoke-StringTemplate -Definition '\u003clanguage\u003e is very \u003cadjective\u003e!' -Parameters @{\n    language = 'PowerShell'\n    adjective = 'cool'\n}\n```\n\n```txt\nPowerShell is very cool!\n```\n\n### Anonymous template with object as parameters\n\n```powershell\n$definition = 'Name: \u003cName\u003e\u003c\\n\u003eCommands: \u003cExportedCommands; separator=\", \"\u003e'\nInvoke-StringTemplate -Definition $definition -Parameters (Get-Module PSReadLine)\n```\n\n```txt\nName: PSReadline\nCommands: Get-PSReadlineKeyHandler, Get-PSReadlineOption, Remove-PSReadlineKeyHandler, Set-PSReadlineKeyHandler, Set-PSReadlineOption, PSConsoleHostReadline\n```\n\n### TemplateGroup definition\n\n```powershell\n$definition = @'\n    Param(parameter) ::= \"[\u003cparameter.ParameterType.Name\u003e] $\u003cparameter.Name\u003e\"\n    Method(member) ::= \u003c\u003c\n[\u003cmember.ReturnType.Name\u003e]\u003cif(member.IsStatic)\u003e static\u003cendif\u003e \u003cmember.Name\u003e (\u003cmember.Parameters:Param(); separator=\", \"\u003e) {\n    throw [NotImplementedException]::new()\n}\n\u003e\u003e\n    Class(Name, DeclaredMethods) ::= \u003c\u003c\nclass MyClass : \u003cName\u003e {\n    \u003cDeclaredMethods:Method(); separator=\"\\n\\n\"\u003e\n}\n\u003e\u003e\n'@\n$group = New-StringTemplateGroup -Definition $definition\n$group | Invoke-StringTemplate -Name Class -Parameters ([System.Runtime.InteropServices.ICustomMarshaler])\n```\n\n```txt\nclass MyClass : ICustomMarshaler {\n    [Object] MarshalNativeToManaged ([IntPtr] $pNativeData) {\n        throw [NotImplementedException]::new()\n    }\n\n    [IntPtr] MarshalManagedToNative ([Object] $ManagedObj) {\n        throw [NotImplementedException]::new()\n    }\n\n    [Void] CleanUpNativeData ([IntPtr] $pNativeData) {\n        throw [NotImplementedException]::new()\n    }\n\n    [Void] CleanUpManagedData ([Object] $ManagedObj) {\n        throw [NotImplementedException]::new()\n    }\n\n    [Int32] GetNativeDataSize () {\n        throw [NotImplementedException]::new()\n    }\n}\n```\n\n## Contributions Welcome!\n\nWe would love to incorporate community contributions into this project.  If you would like to\ncontribute code, documentation, tests, or bug reports, please read our [Contribution Guide](https://github.com/SeeminglyScience/ClassExplorer/tree/master/docs/CONTRIBUTING.md) to learn more.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSeeminglyScience%2FPSStringTemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSeeminglyScience%2FPSStringTemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSeeminglyScience%2FPSStringTemplate/lists"}