File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9191 # region Scan folders
9292 if (Test-PSFParameterBinding - ParameterName " Path" )
9393 {
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 }
9595
9696 foreach ($info in $templateInfos )
9797 {
9898 $data = Import-PSFClixml $info.FullName
99- $data.Path = $info.FullName -replace ' \. Info\.xml$' , ' .xml'
99+ $data.Path = $info.FullName -replace ' - Info\.xml$' , ' .xml'
100100 $prospects += $data
101101 }
102102 }
Original file line number Diff line number Diff line change 11Describe " Verifying templating component" {
22 BeforeAll {
3+ $outPath = (Get-Item - Path ' TestDrive:\' ).FullName
34 $resourcePath = Resolve-PSFPath - Path " $PSScriptRoot \..\resources"
45 $templateName = ' TestTemplate-{0}' -f (Get-Random )
56 }
67
78 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
1011 $templateRaw = Import-PSFClixml - Path $templateInfo.Path
1112 $template = [PSModuleDevelopment.Template.Template ]$templateRaw
1213 $template.Name | Should - Be $templateName
1617 }
1718
1819 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
2021 $content = Get-Content - Path " TestDrive:\Test.txt" - ErrorAction Stop
2122 $values = $content | ConvertFrom-StringData - ErrorAction Stop
2223 $values.Name | Should - Be Test
You can’t perform that action at this time.
0 commit comments