Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tosoikea/PSTemplating
PowerShell tool for generating values out of given schemes.
https://github.com/tosoikea/PSTemplating
generation powershell substitution template
Last synced: 3 months ago
JSON representation
PowerShell tool for generating values out of given schemes.
- Host: GitHub
- URL: https://github.com/tosoikea/PSTemplating
- Owner: tosoikea
- License: mit
- Created: 2019-12-16T18:35:13.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-05-31T19:04:06.000Z (over 2 years ago)
- Last Synced: 2024-05-12T04:34:23.786Z (6 months ago)
- Topics: generation, powershell, substitution, template
- Language: PowerShell
- Homepage: https://www.powershellgallery.com/packages/PSTemplating/0.2.0
- Size: 73.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE.md
Awesome Lists containing this project
- jimsghstars - tosoikea/PSTemplating - PowerShell tool for generating values out of given schemes. (PowerShell)
README
# PSTemplating
The PSTemplating module provides a simple way of generating values based on a schema (template) and variable bindings.
Details about the usage can be found inside the **Wiki**.## Installation
```powershell
Install-Module PSTemplating
```## Basic Usage
While this module can be used for basic substitution of variables with concise values, it's real worth lies within the generation of values based on operations and failovers.
### Basic Substitution
```powershell
ConvertFrom-Schema -Schema "{firstName}.{lastName}" -InputObject @{
"FirstName" = "Max-Test"
"LastName" = "Mustermann"
}
``````powershell
Max-Test.Mustermann
```### Basic Operations
```powershell
ConvertFrom-Schema -Schema "{firstName(lower)(split)}.{lastName(lower)}" -InputObject @{
"FirstName" = "Max-Test"
"LastName" = "Mustermann"
}
``````powershell
max.mustermann
test.mustermann
```### Basic Failover
```powershell
ConvertFrom-Schema -Schema "{firstName(lower)(split)(?countUp[1,3])}.{lastName(lower)}" -InputObject @{
"FirstName" = "Max-Test"
"LastName" = "Mustermann"
}
``````powershell
max.mustermann
test.mustermann
max1.mustermann
max2.mustermann
max3.mustermann
test1.mustermann
test2.mustermann
test3.mustermann
```### Disjunctive Operation Group
```powershell
ConvertFrom-Schema -Schema "ext-{firstName(lower)(split)(sel[0]|sel[0,1]|sel[0,2])}.{lastName(lower)}" -InputObject @{
"FirstName" = "Max-Test"
"LastName" = "Mustermann"
}
``````powershell
ext-m.mustermann
ext-t.mustermann
ext-ma.mustermann
ext-te.mustermann
ext-mx.mustermann
ext-ts.mustermann
```### Conjunctive Operation Group
```powershell
ConvertFrom-Schema -Schema "{lastName(?replace[$, ]&countUp[1,3])}, {firstName}" -InputObject @{
"FirstName" = "Max-Test"
"LastName" = "Mustermann"
}
``````powershell
Mustermann, Max-Test
Mustermann 1, Max-Test
Mustermann 2, Max-Test
Mustermann 3, Max-Test
```## Authors
- **Torben Soennecken**