Skip to content

Commit a54ac11

Browse files
HeyItsGilbertclaude
andcommitted
docs: add comment-based help and fill in PlatyPS stub for ConvertTo-JsonManifest
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7959aea commit a54ac11

2 files changed

Lines changed: 145 additions & 0 deletions

File tree

Plaster/Public/ConvertTo-JsonManifest.ps1

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,41 @@
11
function ConvertTo-JsonManifest {
2+
<#
3+
.SYNOPSIS
4+
Converts a Plaster XML manifest to JSON format.
5+
6+
.DESCRIPTION
7+
Converts an XML-format Plaster manifest (plasterManifest.xml) to the JSON format
8+
(plasterManifest.json) used by Plaster 2.0. Accepts an XmlDocument from
9+
Test-PlasterManifest via the pipeline or the -XmlManifest parameter and returns
10+
the resulting JSON as a string.
11+
12+
.PARAMETER XmlManifest
13+
The parsed XML manifest to convert. Use Test-PlasterManifest to load and validate
14+
a plasterManifest.xml file before passing it to this function.
15+
16+
.PARAMETER Compress
17+
Omits white space and indented formatting in the output JSON string.
18+
19+
.EXAMPLE
20+
$xml = Test-PlasterManifest -Path .\plasterManifest.xml
21+
ConvertTo-JsonManifest -XmlManifest $xml | Set-Content .\plasterManifest.json
22+
23+
Converts plasterManifest.xml and writes the result to plasterManifest.json.
24+
25+
.EXAMPLE
26+
Test-PlasterManifest -Path .\plasterManifest.xml | ConvertTo-JsonManifest | Set-Content .\plasterManifest.json
27+
28+
Pipes the validated manifest directly into ConvertTo-JsonManifest.
29+
30+
.INPUTS
31+
System.Xml.XmlDocument
32+
33+
.OUTPUTS
34+
System.String
35+
36+
.LINK
37+
Test-PlasterManifest
38+
#>
239
[CmdletBinding()]
340
[OutputType([string])]
441
param(
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
external help file: Plaster-help.xml
3+
Module Name: Plaster
4+
online version: https://github.com/PowerShellOrg/Plaster/blob/master/docs/en-US/ConvertTo-JsonManifest.md
5+
schema: 2.0.0
6+
---
7+
8+
# ConvertTo-JsonManifest
9+
10+
## SYNOPSIS
11+
Converts a Plaster XML manifest to JSON format.
12+
13+
## SYNTAX
14+
15+
```
16+
ConvertTo-JsonManifest [-XmlManifest] <XmlDocument> [-Compress] [-ProgressAction <ActionPreference>]
17+
[<CommonParameters>]
18+
```
19+
20+
## DESCRIPTION
21+
Converts an XML-format Plaster manifest (plasterManifest.xml) to the JSON format
22+
(plasterManifest.json) used by Plaster 2.0. Accepts an XmlDocument from
23+
Test-PlasterManifest via the pipeline or the -XmlManifest parameter and returns
24+
the resulting JSON as a string.
25+
26+
## EXAMPLES
27+
28+
### Example 1
29+
```powershell
30+
$xml = Test-PlasterManifest -Path .\plasterManifest.xml
31+
ConvertTo-JsonManifest -XmlManifest $xml | Set-Content .\plasterManifest.json
32+
```
33+
34+
Converts plasterManifest.xml and writes the result to plasterManifest.json.
35+
36+
### Example 2
37+
```powershell
38+
Test-PlasterManifest -Path .\plasterManifest.xml | ConvertTo-JsonManifest | Set-Content .\plasterManifest.json
39+
```
40+
41+
Pipes the validated manifest directly into ConvertTo-JsonManifest.
42+
43+
## PARAMETERS
44+
45+
### -Compress
46+
Omits white space and indented formatting in the output JSON string.
47+
48+
```yaml
49+
Type: SwitchParameter
50+
Parameter Sets: (All)
51+
Aliases:
52+
53+
Required: False
54+
Position: Named
55+
Default value: None
56+
Accept pipeline input: False
57+
Accept wildcard characters: False
58+
```
59+
60+
### -XmlManifest
61+
The parsed XML manifest to convert. Use Test-PlasterManifest to load and validate
62+
a plasterManifest.xml file before passing it to this function.
63+
64+
```yaml
65+
Type: XmlDocument
66+
Parameter Sets: (All)
67+
Aliases:
68+
69+
Required: True
70+
Position: 0
71+
Default value: None
72+
Accept pipeline input: True (ByValue)
73+
Accept wildcard characters: False
74+
```
75+
76+
### -ProgressAction
77+
{{ Fill ProgressAction Description }}
78+
79+
```yaml
80+
Type: ActionPreference
81+
Parameter Sets: (All)
82+
Aliases: proga
83+
84+
Required: False
85+
Position: Named
86+
Default value: None
87+
Accept pipeline input: False
88+
Accept wildcard characters: False
89+
```
90+
91+
### CommonParameters
92+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
93+
94+
## INPUTS
95+
96+
### System.Xml.XmlDocument
97+
The validated XML manifest returned by Test-PlasterManifest.
98+
99+
## OUTPUTS
100+
101+
### System.String
102+
A JSON string representation of the Plaster manifest.
103+
104+
## NOTES
105+
106+
## RELATED LINKS
107+
108+
[Test-PlasterManifest](https://github.com/PowerShellOrg/Plaster/blob/master/docs/en-US/Test-PlasterManifest.md)

0 commit comments

Comments
 (0)