@@ -263,6 +263,138 @@ exterioraccess : False</dev:code>
263
263
</maml : navigationLink >
264
264
</command : relatedLinks >
265
265
</command : command >
266
+ <command : command xmlns : maml =" http://schemas.microsoft.com/maml/2004/10" xmlns : command =" http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns : dev =" http://schemas.microsoft.com/maml/dev/2004/10" xmlns : MSHelp =" http://msdn.microsoft.com/mshelp" >
267
+ <command : details >
268
+ <command : name >ConvertTo-SchemaDefinition</command : name >
269
+ <command : verb >ConvertTo</command : verb >
270
+ <command : noun >SchemaDefinition</command : noun >
271
+ <maml : description >
272
+ <maml : para >This function takes an object that has the format of a Schema Definition and converts it into the schemaDefinition class. It can also return as either the schemaDefinition class or a json string.</maml : para >
273
+ </maml : description >
274
+ </command : details >
275
+ <maml : description >
276
+ <maml : para >This function takes an object that has the format of a Schema Definition and converts it into the schemaDefinition class. It can also return as either the schemaDefinition class or a json string.</maml : para >
277
+ </maml : description >
278
+ <command : syntax >
279
+ <command : syntaxItem >
280
+ <maml : name >ConvertTo-SchemaDefinition</maml : name >
281
+ <command : parameter required =" true" variableLength =" true" globbing =" false" pipelineInput =" False" position =" 0" aliases =" none" >
282
+ <maml : name >Definition</maml : name >
283
+ <maml : Description >
284
+ <maml : para >This is a JSON Schema definition as defined by the json-schema.org (see related links below). This object is then converted into a PowerShell object that can be used like any other PowerShell object.</maml : para >
285
+ <maml : para >{ "type": [ "object" ], "properties": { "Id": { "type": "string" }, "Regions": { "type": "array", "items": { "$ref": "#/definitions/Region" } } }, "required": [ "Id", "Regions" ] }</maml : para >
286
+ </maml : Description >
287
+ <command : parameterValue required =" true" variableLength =" false" >System.Object</command : parameterValue >
288
+ <dev : type >
289
+ <maml : name >System.Object</maml : name >
290
+ <maml : uri />
291
+ </dev : type >
292
+ <dev : defaultValue >None</dev : defaultValue >
293
+ </command : parameter >
294
+ <command : parameter required =" false" variableLength =" true" globbing =" false" pipelineInput =" False" position =" named" aliases =" none" >
295
+ <maml : name >AsJson</maml : name >
296
+ <maml : Description >
297
+ <maml : para >Allows the funciton to return a string in JSON format.</maml : para >
298
+ </maml : Description >
299
+ <dev : type >
300
+ <maml : name >System.Management.Automation.SwitchParameter</maml : name >
301
+ <maml : uri />
302
+ </dev : type >
303
+ <dev : defaultValue >False</dev : defaultValue >
304
+ </command : parameter >
305
+ </command : syntaxItem >
306
+ </command : syntax >
307
+ <command : parameters >
308
+ <command : parameter required =" false" variableLength =" true" globbing =" false" pipelineInput =" False" position =" named" aliases =" none" >
309
+ <maml : name >AsJson</maml : name >
310
+ <maml : Description >
311
+ <maml : para >Allows the funciton to return a string in JSON format.</maml : para >
312
+ </maml : Description >
313
+ <command : parameterValue required =" true" variableLength =" false" >System.Management.Automation.SwitchParameter</command : parameterValue >
314
+ <dev : type >
315
+ <maml : name >System.Management.Automation.SwitchParameter</maml : name >
316
+ <maml : uri />
317
+ </dev : type >
318
+ <dev : defaultValue >False</dev : defaultValue >
319
+ </command : parameter >
320
+ <command : parameter required =" true" variableLength =" true" globbing =" false" pipelineInput =" False" position =" 0" aliases =" none" >
321
+ <maml : name >Definition</maml : name >
322
+ <maml : Description >
323
+ <maml : para >This is a JSON Schema definition as defined by the json-schema.org (see related links below). This object is then converted into a PowerShell object that can be used like any other PowerShell object.</maml : para >
324
+ <maml : para >{ "type": [ "object" ], "properties": { "Id": { "type": "string" }, "Regions": { "type": "array", "items": { "$ref": "#/definitions/Region" } } }, "required": [ "Id", "Regions" ] }</maml : para >
325
+ </maml : Description >
326
+ <command : parameterValue required =" true" variableLength =" false" >System.Object</command : parameterValue >
327
+ <dev : type >
328
+ <maml : name >System.Object</maml : name >
329
+ <maml : uri />
330
+ </dev : type >
331
+ <dev : defaultValue >None</dev : defaultValue >
332
+ </command : parameter >
333
+ </command : parameters >
334
+ <command : inputTypes >
335
+ <command : inputType >
336
+ <dev : type >
337
+ <maml : name >None</maml : name >
338
+ </dev : type >
339
+ <maml : description >
340
+ <maml : para ></maml : para >
341
+ </maml : description >
342
+ </command : inputType >
343
+ </command : inputTypes >
344
+ <command : returnValues >
345
+ <command : returnValue >
346
+ <dev : type >
347
+ <maml : name >schemaDefinition</maml : name >
348
+ </dev : type >
349
+ <maml : description >
350
+ <maml : para >This class is really modified object that contains the $schema attribute as well as validation on what values can be present for that attribute. Schema Definition (https://json-schema.org/understanding-json-schema/structuring.html#defs) Schema Keyword (https://json-schema.org/understanding-json-schema/reference/schema.html) Schema Types (https://json-schema.org/understanding-json-schema/reference/type.html)</maml : para >
351
+ </maml : description >
352
+ </command : returnValue >
353
+ </command : returnValues >
354
+ <maml : alertSet >
355
+ <maml : alert >
356
+ <maml : para ></maml : para >
357
+ </maml : alert >
358
+ </maml : alertSet >
359
+ <command : examples >
360
+ <command : example >
361
+ <maml : title >-------------------------- Example 1 --------------------------</maml : title >
362
+ <dev : code >PS C:\> $Schema = Get-SchemaDocument -Path 'D:\TEMP\test\schema-sample.json'
363
+
364
+ ConvertTo-SchemaDefinition -Definition $Schema.definitions.room
365
+
366
+
367
+ type : object
368
+ properties : @{Id=; Title;Description=}
369
+ required :</dev : code >
370
+ <dev : remarks >
371
+ <maml : para >This example shows how to use the function to convert an object into a schema class.</maml : para >
372
+ </dev : remarks >
373
+ </command : example >
374
+ </command : examples >
375
+ <command : relatedLinks >
376
+ <maml : navigationLink >
377
+ <maml : linkText >Online Version:</maml : linkText >
378
+ <maml : uri >https://github.com/SchemaModule/PowerShell/blob/master/docs/ConvertTo-SchemaDefinition.md#convertto-schemadefinition</maml : uri >
379
+ </maml : navigationLink >
380
+ <maml : navigationLink >
381
+ <maml : linkText >Get-SchemaDocument</maml : linkText >
382
+ <maml : uri >https://github.com/SchemaModule/PowerShell/blob/master/docs/Get-SchemaDocument.md#get-schemadocument</maml : uri >
383
+ </maml : navigationLink >
384
+ <maml : navigationLink >
385
+ <maml : linkText >New-SchemaProperty</maml : linkText >
386
+ <maml : uri >https://github.com/SchemaModule/PowerShell/blob/master/docs/New-SchemaProperty.md#new-schemaproperty</maml : uri >
387
+ </maml : navigationLink >
388
+ <maml : navigationLink >
389
+ <maml : linkText >About Classes</maml : linkText >
390
+ <maml : uri >https://github.com/SchemaModule/PowerShell/blob/master/docs/about_Schema_Classes.md</maml : uri >
391
+ </maml : navigationLink >
392
+ <maml : navigationLink >
393
+ <maml : linkText >JSON Schema Reference</maml : linkText >
394
+ <maml : uri >https://json-schema.org/understanding-json-schema/reference/index.html</maml : uri >
395
+ </maml : navigationLink >
396
+ </command : relatedLinks >
397
+ </command : command >
266
398
<command : command xmlns : maml =" http://schemas.microsoft.com/maml/2004/10" xmlns : command =" http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns : dev =" http://schemas.microsoft.com/maml/dev/2004/10" xmlns : MSHelp =" http://msdn.microsoft.com/mshelp" >
267
399
<command : details >
268
400
<command : name >ConvertTo-SchemaElement</command : name >
@@ -295,7 +427,7 @@ exterioraccess : False</dev:code>
295
427
<command : parameter required =" false" variableLength =" true" globbing =" false" pipelineInput =" False" position =" named" aliases =" none" >
296
428
<maml : name >IsRootSchema</maml : name >
297
429
<maml : Description >
298
- <maml : para >{{ Fill IsRootSchema Description }} </maml : para >
430
+ <maml : para >This switch allows the function to know when it's working with the root of a schema document versus a regular object. </maml : para >
299
431
</maml : Description >
300
432
<dev : type >
301
433
<maml : name >System.Management.Automation.SwitchParameter</maml : name >
@@ -309,7 +441,7 @@ exterioraccess : False</dev:code>
309
441
<command : parameter required =" false" variableLength =" true" globbing =" false" pipelineInput =" False" position =" named" aliases =" none" >
310
442
<maml : name >IsRootSchema</maml : name >
311
443
<maml : Description >
312
- <maml : para >{{ Fill IsRootSchema Description }} </maml : para >
444
+ <maml : para >This switch allows the function to know when it's working with the root of a schema document versus a regular object. </maml : para >
313
445
</maml : Description >
314
446
<command : parameterValue required =" true" variableLength =" false" >System.Management.Automation.SwitchParameter</command : parameterValue >
315
447
<dev : type >
0 commit comments