Skip to content

Commit 2aee4df

Browse files
Merge pull request #12 from SchemaModule/issue-11
Closes issue #11
2 parents 761106e + 80b7abb commit 2aee4df

File tree

5 files changed

+44
-28
lines changed

5 files changed

+44
-28
lines changed

docs/Get-SchemaArray.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ schema: 2.0.0
1313
## SYNTAX
1414

1515
```
16-
Get-SchemaArray [[-Schema] <Object>]
16+
Get-SchemaArray [[-SchemaDocument] <Object>] [<CommonParameters>]
1717
```
1818

1919
## DESCRIPTION
@@ -30,8 +30,8 @@ PS C:\> {{ Add example code here }}
3030

3131
## PARAMETERS
3232

33-
### -Schema
34-
{{ Fill Schema Description }}
33+
### -SchemaDocument
34+
{{ Fill SchemaDocument Description }}
3535

3636
```yaml
3737
Type: Object
@@ -41,17 +41,21 @@ Aliases:
4141
Required: False
4242
Position: 0
4343
Default value: None
44-
Accept pipeline input: False
44+
Accept pipeline input: True (ByValue)
4545
Accept wildcard characters: False
4646
```
4747
48+
### CommonParameters
49+
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).
50+
4851
## INPUTS
4952
50-
### None
53+
### System.Object
5154
5255
## OUTPUTS
5356
54-
### System.Object
57+
### System.Array
58+
5559
## NOTES
5660
5761
## RELATED LINKS

docs/Get-SchemaDocument.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ schema: 2.0.0
1313
## SYNTAX
1414

1515
```
16-
Get-SchemaDocument [[-Path] <String>]
16+
Get-SchemaDocument [[-Path] <String>] [<CommonParameters>]
1717
```
1818

1919
## DESCRIPTION
@@ -41,17 +41,21 @@ Aliases:
4141
Required: False
4242
Position: 0
4343
Default value: None
44-
Accept pipeline input: False
44+
Accept pipeline input: True (ByValue)
4545
Accept wildcard characters: False
4646
```
4747
48+
### CommonParameters
49+
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).
50+
4851
## INPUTS
4952
50-
### None
53+
### System.String
5154
5255
## OUTPUTS
5356
5457
### System.Object
58+
5559
## NOTES
5660
5761
## RELATED LINKS

docs/Get-SchemaObject.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ schema: 2.0.0
1313
## SYNTAX
1414

1515
```
16-
Get-SchemaObject [[-Schema] <Object>]
16+
Get-SchemaObject [[-SchemaDocument] <Object>] [<CommonParameters>]
1717
```
1818

1919
## DESCRIPTION
@@ -30,8 +30,8 @@ PS C:\> {{ Add example code here }}
3030

3131
## PARAMETERS
3232

33-
### -Schema
34-
{{ Fill Schema Description }}
33+
### -SchemaDocument
34+
{{ Fill SchemaDocument Description }}
3535

3636
```yaml
3737
Type: Object
@@ -41,17 +41,21 @@ Aliases:
4141
Required: False
4242
Position: 0
4343
Default value: None
44-
Accept pipeline input: False
44+
Accept pipeline input: True (ByValue)
4545
Accept wildcard characters: False
4646
```
4747
48+
### CommonParameters
49+
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).
50+
4851
## INPUTS
4952
50-
### None
53+
### System.Object
5154
5255
## OUTPUTS
5356
5457
### System.Object
58+
5559
## NOTES
5660
5761
## RELATED LINKS

docs/Get-SchemaProperty.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ schema: 2.0.0
1313
## SYNTAX
1414

1515
```
16-
Get-SchemaProperty [[-Schema] <Object>] [[-Name] <String>]
16+
Get-SchemaProperty [[-SchemaDocument] <Object>] [[-Name] <String>] [<CommonParameters>]
1717
```
1818

1919
## DESCRIPTION
@@ -45,8 +45,8 @@ Accept pipeline input: False
4545
Accept wildcard characters: False
4646
```
4747
48-
### -Schema
49-
{{ Fill Schema Description }}
48+
### -SchemaDocument
49+
{{ Fill SchemaDocument Description }}
5050
5151
```yaml
5252
Type: Object
@@ -56,17 +56,21 @@ Aliases:
5656
Required: False
5757
Position: 0
5858
Default value: None
59-
Accept pipeline input: False
59+
Accept pipeline input: True (ByValue)
6060
Accept wildcard characters: False
6161
```
6262
63+
### CommonParameters
64+
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).
65+
6366
## INPUTS
6467
65-
### None
68+
### System.Object
6669
6770
## OUTPUTS
6871
6972
### System.Object
73+
7074
## NOTES
7175
7276
## RELATED LINKS

schema/schema.psm1

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ function Get-Object {
3939
[OutputType([Object])]
4040
param (
4141
[Parameter(ValueFromPipeline)]
42-
[object]$Schema
42+
[object]$SchemaDocument
4343
)
4444

4545
process {
46-
$Properties = $Schema.properties | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty Name;
46+
$Properties = $SchemaDocument.properties | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty Name;
4747
$Members = @{};
4848
foreach ($Property in $Properties) {
49-
switch ($Schema.properties.$Property.type) {
49+
switch ($SchemaDocument.properties.$Property.type) {
5050
'object' {
5151
$Members.Add($Property, (New-Object -TypeName psobject -Property @{}))
5252
}
@@ -71,14 +71,14 @@ function Get-Array {
7171
[OutputType([Array])]
7272
param (
7373
[Parameter(ValueFromPipeline)]
74-
[object]$Schema
74+
[object]$SchemaDocument
7575
)
7676

7777
process {
78-
$Properties = $Schema.items.anyOf.properties | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty Name;
78+
$Properties = $SchemaDocument.items.anyOf.properties | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty Name;
7979
$Members = @{};
8080
foreach ($Property in $Properties) {
81-
switch ($Schema.items.anyOf.properties.$Property.type) {
81+
switch ($SchemaDocument.items.anyOf.properties.$Property.type) {
8282
'object' {
8383
$Members.Add($Property, (New-Object -TypeName psobject -Property @{}))
8484
}
@@ -103,16 +103,16 @@ function Get-Property {
103103
[OutputType([Object])]
104104
param (
105105
[Parameter(ValueFromPipeline)]
106-
[object]$Schema,
106+
[object]$SchemaDocument,
107107
[string]$Name
108108
)
109109

110110
process {
111111
if ($Name) {
112-
$Schema.properties.$Name;
112+
$SchemaDocument.properties.$Name;
113113
}
114114
else {
115-
$Schema.properties;
115+
$SchemaDocument.properties;
116116
}
117117
}
118118
}

0 commit comments

Comments
 (0)