Skip to content

Commit d09b612

Browse files
Update Templates.Tests.ps1
1 parent b03ce93 commit d09b612

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

PSModuleDevelopment/tests/functions/Templates.Tests.ps1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,16 @@
99
{ New-PSMDTemplate -TemplateName $templateName -FilePath "$resourcePath\þnameþ.txt" -OutPath $outPath -EnableException -ErrorAction Stop } | Should -Not -Throw
1010
$templateInfo = Get-PSMDTemplate -TemplateName $templateName -Path $outPath
1111
$templateRaw = Import-PSFClixml -Path $templateInfo.Path
12-
$template = [PSModuleDevelopment.Template.Template]$templateRaw
12+
try { $template = [PSModuleDevelopment.Template.Template]$templateRaw }
13+
catch {
14+
Write-Warning "Conversion to template Failed!"
15+
Write-Warning "======================================================================="
16+
$_ | Format-List -Force | Out-Host
17+
Write-Warning "======================================================================="
18+
$_.Exception | Format-List -Force | Out-Host
19+
Write-Warning "======================================================================="
20+
throw
21+
}
1322
$template.Name | Should -Be $templateName
1423
$template.Parameters.Count | Should -Be 1
1524
$template.Scripts.Count | Should -Be 1

0 commit comments

Comments
 (0)