File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 91
91
# region Scan folders
92
92
if (Test-PSFParameterBinding - ParameterName " Path" )
93
93
{
94
- $templateInfos = Get-ChildItem - Path $Path - Filter " $ ( $TemplateName ) -*. Info.xml" | Where-Object { ($_.Name -replace " -\d+(\.\d+){0,3}. Info.xml$" ) -like $TemplateName }
94
+ $templateInfos = Get-ChildItem - Path $Path - Filter " $ ( $TemplateName ) -*- Info.xml" | Where-Object { ($_.Name -replace " -\d+(\.\d+){0,3}- Info.xml$" ) -like $TemplateName }
95
95
96
96
foreach ($info in $templateInfos )
97
97
{
98
98
$data = Import-PSFClixml $info.FullName
99
- $data.Path = $info.FullName -replace ' \. Info\.xml$' , ' .xml'
99
+ $data.Path = $info.FullName -replace ' - Info\.xml$' , ' .xml'
100
100
$prospects += $data
101
101
}
102
102
}
Original file line number Diff line number Diff line change 1
1
Describe " Verifying templating component" {
2
2
BeforeAll {
3
+ $outPath = (Get-Item - Path ' TestDrive:\' ).FullName
3
4
$resourcePath = Resolve-PSFPath - Path " $PSScriptRoot \..\resources"
4
5
$templateName = ' TestTemplate-{0}' -f (Get-Random )
5
6
}
6
7
7
8
It " Should Record the template correctly" {
8
- { New-PSMDTemplate - TemplateName $templateName - FilePath " $resourcePath \þnameþ.txt" - EnableException - ErrorAction Stop } | Should -Not - Throw
9
- $templateInfo = Get-PSMDTemplate - TemplateName $templateName
9
+ { New-PSMDTemplate - TemplateName $templateName - FilePath " $resourcePath \þnameþ.txt" - OutPath $outPath - EnableException - ErrorAction Stop } | Should -Not - Throw
10
+ $templateInfo = Get-PSMDTemplate - TemplateName $templateName - Path $outPath
10
11
$templateRaw = Import-PSFClixml - Path $templateInfo.Path
11
12
$template = [PSModuleDevelopment.Template.Template ]$templateRaw
12
13
$template.Name | Should - Be $templateName
16
17
}
17
18
18
19
It " Should Invoke the template correctly" {
19
- { Invoke-PSMDTemplate - TemplateName $templateName - OutPath TestDrive:\ - Name Test - EnableException } | Should -Not - Throw
20
+ { Invoke-PSMDTemplate - TemplateName $templateName - Path $outPath - OutPath $outPath - Name Test - EnableException } | Should -Not - Throw
20
21
$content = Get-Content - Path " TestDrive:\Test.txt" - ErrorAction Stop
21
22
$values = $content | ConvertFrom-StringData - ErrorAction Stop
22
23
$values.Name | Should - Be Test
You can’t perform that action at this time.
0 commit comments