File tree Expand file tree Collapse file tree 4 files changed +19
-7
lines changed Expand file tree Collapse file tree 4 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 1
1
[ ![ GitHub workflows (all tests)] ( https://github.com/wild-devops/pwshake/workflows/all%20tests/badge.svg )] ( ../../actions/workflows/tests.yml )
2
- [ ![ GitHub release (latest by date)] ( https://img.shields.io/github/v/release/wild-devops/pwshake )] ( ../../releases/tag/v1.5.2 )
2
+ [ ![ GitHub release (latest by date)] ( https://img.shields.io/github/v/release/wild-devops/pwshake )] ( ../../releases/tag/v1.5.3 )
3
3
[ ![ PowerShell Gallery] ( https://img.shields.io/powershellgallery/v/pwshake )] ( https://www.powershellgallery.com/packages/pwshake )
4
4
[ ![ PowerShell Gallery] ( https://img.shields.io/powershellgallery/dt/pwshake )] ( https://www.powershellgallery.com/packages/pwshake )
5
5
@@ -123,7 +123,7 @@ invoke_tasks:
123
123
attributes:
124
124
pwshake_module_path: /path/to/pwshake/module/source
125
125
pwshake_path: /absolute/path/to/your/working/directory
126
- pwshake_version: 1.5.2
126
+ pwshake_version: 1.5.3
127
127
work_dir: /absolute/path/to/process/working/directory
128
128
pwshake_log_path: /absolute/path/to/your/working/directory/my_pwshake.log
129
129
some_attribute: this is an attribute value
Original file line number Diff line number Diff line change 12
12
RootModule = ' pwshake.psm1'
13
13
14
14
# Version number of this module.
15
- ModuleVersion = ' 1.5.2 '
15
+ ModuleVersion = ' 1.5.3 '
16
16
17
17
# Supported PSEditions
18
18
# CompatiblePSEditions = @()
52
52
53
53
# Modules that must be imported into the global environment prior to importing this module
54
54
RequiredModules = @ (
55
- @ {ModuleName = " powershell-yaml" ; RequiredVersion = " 0.4.0 " ; Guid = " 6a75a662-7f53-425a-9777-ee61284407da" }
55
+ @ {ModuleName = " powershell-yaml" ; RequiredVersion = " 0.4.2 " ; Guid = " 6a75a662-7f53-425a-9777-ee61284407da" }
56
56
)
57
57
58
58
# Assemblies that must be loaded prior to importing this module
Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ function Interpolate-Attributes {
13
13
do {
14
14
foreach ($substitute in (Get-Matches $json $regex ' subst' )) {
15
15
" Interpolate-Attributes:$ ( $counter ) :`$ substitute:$substitute " | f- log- dbg
16
- if ($substitute -match ' ^\$\((?<eval>.*)\)$' ) {
16
+ if ($substitute -match ' (?ms) ^\$\((?<eval>.*)\)$' ) {
17
17
" Interpolate-Attributes:$ ( $counter ) :`$ eval:{$ ( $matches.eval ) }" | f- log- dbg
18
18
$value = " `" $ ( $matches.eval ) `" " | ConvertFrom-Json | Invoke-Expression
19
- } elseif ($substitute -match ' ^(?<filter>\$\S+):(?<input>.*)' ) {
19
+ } elseif ($substitute -match ' (?ms) ^(?<filter>\$\S+? ):(?<input>.*)$ ' ) {
20
20
" Interpolate-Attributes:$ ( $counter ) :`$ filter:{$ ( $matches.filter ) }:`$ input:{$ ( $matches.input ) }" | f- log- dbg
21
21
$value = " `" $ ( $matches.input ) `" " | ConvertFrom-Json | & f- $ ($matches.filter )
22
22
" Interpolate-Attributes:$ ( $counter ) :`$ value:{$value }" | f- log- dbg
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ Context "Interpolate-Attributes" {
62
62
@ {When = ' {{a}}' ;And = ' dev' ;Then = ' .dev' }
63
63
@ {When = ' {{b}}' ;And = ' dev' ;Then = ' .dev' }
64
64
) {param ($When , $And , $Then )
65
- $subst = ' {{$("' + $When + ' " | ? {$_} | % {".$_"})}}'
65
+ $subst = ' {{$("' + $When + ' " | ? {$_} | % {' + [ Environment ]::NewLine + ' ".$_"})}}'
66
66
(Interpolate- Attributes @ {
67
67
attributes = @ {
68
68
a = $And
@@ -133,4 +133,16 @@ Context "Interpolate-Attributes" {
133
133
$actual.attributes.b | Should - Be $chars
134
134
$actual.attributes.c | Should - Be $chars
135
135
}
136
+
137
+ It " Should substitute filters with multiple ':' separators and multiline input" {
138
+ $expected = " https://some.url/?other`n value1:value2"
139
+
140
+ Interpolate- Attributes @ {
141
+ attributes = @ {a = " {{b}}" ;b = ' {{$secured:{{c}}}}' ;c = $expected };
142
+ } | New-Variable - Name actual
143
+
144
+ $actual.attributes.a | Should - Be $expected
145
+ $actual.attributes.b | Should - Be $expected
146
+ $actual.attributes.c | Should - Be $expected
147
+ }
136
148
}
You can’t perform that action at this time.
0 commit comments