Skip to content

Commit 5b97c12

Browse files
Merge pull request #33 from SchemaModule/item-38
Item 38 : Added missing New-SchemaBoolean function and supporting help
2 parents 95d47f9 + 30aa4b9 commit 5b97c12

File tree

7 files changed

+3424
-6
lines changed

7 files changed

+3424
-6
lines changed

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,73 @@
11
# Changelog
2+
23
All changes to this module should be reflected in this document.
34

45
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
56
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
67

78
## Unreleased
89

10+
## [2.0.0] - 2020-12-22
11+
12+
### Added
13+
14+
- Added classes to define JSON schema objects
15+
- Added utility methods to classes
16+
- Added Functions to support the classes
17+
- New-SchemaElement
18+
- New-SchemaString
19+
- New-SchemaInteger
20+
- New-SchemaNumber
21+
- New-SchemaProperty
22+
- Get-SchemaDefinition
23+
- Get-SchemaReference
24+
- Find-SchemaElement
25+
- ConvertTo-SchemaElement
26+
- ConvertFrom-SchemaObject
27+
- ConvertFrom-SchemaArray
28+
- Format-SchemaDocument
29+
- Added support for types (schema.types.ps1xml)
30+
- Added support for formatting (schema.format.ps1xml)
31+
32+
### Updated
33+
34+
- Get-SchemaDocument has been udpated to work with the new functions
35+
36+
### Removed
37+
38+
- Get-SchemaArray
39+
- Get-SchemaObject
40+
- Get-SchemaProperty
41+
942
## [1.1.0] - 2020-09-11
43+
1044
### Added
45+
1146
- Updatable Help Support
1247

1348
## [1.0.0] - 2020-09-09
49+
1450
### Added
51+
1552
- Updated documentation and external help
1653
- CHNAGELOG added
1754
- psakefile added
1855
- Added JSON logo
1956

2057
### Changed
58+
2159
- README
2260
- Definition File updated with URLs and new version
2361

2462
### Fixed
63+
2564
- Missing some JSON data types, bool and int
2665
- Write-Verbose acts different for arrays, so corrected the output
2766

2867
## [0.0.1] - 2020-09-08
68+
2969
### Added
70+
3071
- Repository Created
3172
- Module manifest created
3273
- Module file copied from outside repository

docs/New-SchemaBoolean.md

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
---
2+
external help file: schema-help.xml
3+
Module Name: schema
4+
online version: https://github.com/SchemaModule/PowerShell/blob/master/docs/New-SchemaBoolean.md#new-schemaboolean
5+
schema: 2.0.0
6+
---
7+
8+
# New-SchemaBoolean
9+
10+
## SYNOPSIS
11+
12+
A function to create new Schema Boolean object
13+
14+
## SYNTAX
15+
16+
```
17+
New-SchemaBoolean [-id <String>] [-ref <String>] [-title <String>] [-description <String>] [-default <Boolean>]
18+
[-WhatIf] [-Confirm] [<CommonParameters>]
19+
```
20+
21+
## DESCRIPTION
22+
23+
A function to create new Schema Boolean object
24+
25+
## EXAMPLES
26+
27+
### Example 1
28+
29+
```powershell
30+
New-SchemaBoolean -title ExteriorAccess -description "Does the room have an exterior door" -default $false
31+
32+
33+
$id :
34+
title : ExteriorAccess
35+
description : Does the room have an exterior door
36+
default : False
37+
```
38+
39+
A simple example of usage
40+
41+
## PARAMETERS
42+
43+
### -default
44+
45+
The default keyword specifies a default value for an item.
46+
47+
```yaml
48+
Type: System.Boolean
49+
Parameter Sets: (All)
50+
Aliases:
51+
52+
Required: False
53+
Position: Named
54+
Default value: None
55+
Accept pipeline input: False
56+
Accept wildcard characters: False
57+
```
58+
59+
### -description
60+
61+
The title and description keywords must be strings. A "description" will provide
62+
a more lengthy explanation about the purpose of the data described by the schema
63+
64+
```yaml
65+
Type: System.String
66+
Parameter Sets: (All)
67+
Aliases:
68+
69+
Required: False
70+
Position: Named
71+
Default value: None
72+
Accept pipeline input: False
73+
Accept wildcard characters: False
74+
```
75+
76+
### -id
77+
78+
The $id property is a URI-reference that serves two purposes, it declares a
79+
unique identifier for the schema and it declares a base URI against which $ref
80+
URI-references are resolved.
81+
82+
```yaml
83+
Type: System.String
84+
Parameter Sets: (All)
85+
Aliases:
86+
87+
Required: False
88+
Position: Named
89+
Default value: None
90+
Accept pipeline input: False
91+
Accept wildcard characters: False
92+
```
93+
94+
### -ref
95+
96+
The $id property is a URI-reference that serves two purposes, it declares a
97+
unique identifier for the schema and it declares a base URI against which $ref
98+
URI-references are resolved.
99+
100+
```yaml
101+
Type: System.String
102+
Parameter Sets: (All)
103+
Aliases:
104+
105+
Required: False
106+
Position: Named
107+
Default value: None
108+
Accept pipeline input: False
109+
Accept wildcard characters: False
110+
```
111+
112+
### -title
113+
114+
The title and description keywords must be strings. A "title" will preferably be
115+
short explanation about the purpose of the data described by the schema.
116+
117+
```yaml
118+
Type: System.String
119+
Parameter Sets: (All)
120+
Aliases:
121+
122+
Required: False
123+
Position: Named
124+
Default value: None
125+
Accept pipeline input: False
126+
Accept wildcard characters: False
127+
```
128+
129+
### -Confirm
130+
131+
Prompts you for confirmation before running the cmdlet.
132+
133+
```yaml
134+
Type: System.Management.Automation.SwitchParameter
135+
Parameter Sets: (All)
136+
Aliases: cf
137+
138+
Required: False
139+
Position: Named
140+
Default value: None
141+
Accept pipeline input: False
142+
Accept wildcard characters: False
143+
```
144+
145+
### -WhatIf
146+
147+
Shows what would happen if the cmdlet runs.
148+
The cmdlet is not run.
149+
150+
```yaml
151+
Type: System.Management.Automation.SwitchParameter
152+
Parameter Sets: (All)
153+
Aliases: wi
154+
155+
Required: False
156+
Position: Named
157+
Default value: None
158+
Accept pipeline input: False
159+
Accept wildcard characters: False
160+
```
161+
162+
### CommonParameters
163+
164+
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).
165+
166+
## INPUTS
167+
168+
### None
169+
170+
## OUTPUTS
171+
172+
### schemaBoolean
173+
174+
The boolean type matches only two special values: true and false. Note that
175+
values that evaluate to true or false, such as 1 and 0, are not accepted by
176+
the schema.
177+
178+
[Schema Boolean](http://json-schema.org/understanding-json-schema/reference/boolean.html)
179+
180+
[Schema Types](https://json-schema.org/understanding-json-schema/reference/type.html)
181+
182+
## NOTES
183+
184+
## RELATED LINKS
185+
186+
[New-SchemaElement](https://github.com/SchemaModule/PowerShell/blob/master/docs/New-SchemaElement.md#new-schemaelement)
187+
188+
[About Classes](https://github.com/SchemaModule/PowerShell/blob/master/docs/about_Schema_Classes.md)
189+
190+
[JSON Schema Reference](https://json-schema.org/understanding-json-schema/reference/index.html)

docs/schema.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ A function to follow the ref keyword and return the referenced schema
5656

5757
A function to create new Schema Integer object
5858

59+
### [New-SchemaBoolean](New-SchemaBoolean.md)
60+
61+
A function to create new Schema Boolean object
62+
5963
### [New-SchemaNumber](New-SchemaNumber.md)
6064

6165
A function to create new Schema Number object

0 commit comments

Comments
 (0)