@@ -72,7 +72,20 @@ function Invoke-Plaster {
7272 # since we are only evaluating the parameters in the manifest - no need for Test-ConditionAttribute as we
7373 # are not building up multiple parametersets. And no need for EvaluateAttributeValue since we are only
7474 # grabbing the parameter's value which is static.
75- $templateAbsolutePath = $ExecutionConteut # Load manifest file using culture lookup
75+ # Load manifest file using culture lookup - try both JSON and XML formats
76+ $manifestPath = GetPlasterManifestPathForCulture $templateAbsolutePath $PSCulture
77+
78+ # If XML not found, try JSON
79+ if (($null -eq $manifestPath ) -or (! (Test-Path $manifestPath ))) {
80+ $jsonManifestPath = Join-Path $templateAbsolutePath ' plasterManifest.json'
81+ if (Test-Path $jsonManifestPath ) {
82+ $manifestPath = $jsonManifestPath
83+ }
84+ }
85+
86+ if (($null -eq $manifestPath ) -or (! (Test-Path $manifestPath ))) {
87+ return
88+ }
7689 # Determine manifest type and process accordingly
7790 try {
7891 $manifestType = Get-PlasterManifestType - ManifestPath $manifestPath
@@ -242,8 +255,7 @@ function Invoke-Plaster {
242255
243256 } else {
244257 # Load XML manifest
245-
246- if (Test-Path - LiteralPath $manifestPath - PathType Leaf) {
258+ if ($manifestPath -and (Test-Path - LiteralPath $manifestPath - PathType Leaf)) {
247259 $manifest = Test-PlasterManifest - Path $manifestPath - ErrorAction Stop 3> $null
248260 $PSCmdlet.WriteDebug (" Loading XML manifest file '$manifestPath '" )
249261 } else {
@@ -262,16 +274,16 @@ function Invoke-Plaster {
262274 # Prepare output object if user has specified the -PassThru parameter.
263275 if ($PassThru ) {
264276 $InvokePlasterInfo = [PSCustomObject ]@ {
265- TemplatePath = if ($templateAbsolutePath ) { $templateAbsolutePath } else { ' Inline Definition' }
277+ TemplatePath = if ($templateAbsolutePath ) { $templateAbsolutePath } else { ' Inline Definition' }
266278 DestinationPath = $destinationAbsolutePath
267- ManifestType = $manifestType
268- Success = $false
269- TemplateType = if ($manifest.plasterManifest.templateType ) { $manifest.plasterManifest.templateType } else { ' Unspecified' }
270- CreatedFiles = [string []]@ ()
271- UpdatedFiles = [string []]@ ()
272- MissingModules = [string []]@ ()
273- OpenFiles = [string []]@ ()
274- ProcessingTime = $null
279+ ManifestType = $manifestType
280+ Success = $false
281+ TemplateType = if ($manifest.plasterManifest.templateType ) { $manifest.plasterManifest.templateType } else { ' Unspecified' }
282+ CreatedFiles = [string []]@ ()
283+ UpdatedFiles = [string []]@ ()
284+ MissingModules = [string []]@ ()
285+ OpenFiles = [string []]@ ()
286+ ProcessingTime = $null
275287 }
276288 }
277289
@@ -357,8 +369,7 @@ function Invoke-Plaster {
357369 } else {
358370 Write-PlasterLog - Level Information - Message " Template processing completed successfully in $ ( $stopwatch.Elapsed.TotalSeconds ) seconds"
359371 }
360- }
361- catch {
372+ } catch {
362373 $stopwatch.Stop ()
363374 $errorMessage = " Template processing failed after $ ( $stopwatch.Elapsed.TotalSeconds ) seconds: $ ( $_.Exception.Message ) "
364375 Write-PlasterLog - Level Error - Message $errorMessage
@@ -370,8 +381,7 @@ function Invoke-Plaster {
370381 }
371382
372383 throw $_
373- }
374- finally {
384+ } finally {
375385 # Enhanced cleanup
376386 if ($script :constrainedRunspace ) {
377387 $script :constrainedRunspace.Dispose ()
0 commit comments