en-us/schema-help.xml
<?xml version="1.0" encoding="utf-8"?>
<helpItems schema="maml" xmlns="http://msh"> <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"> <command:details> <command:name>Get-SchemaArray</command:name> <command:verb>Get</command:verb> <command:noun>SchemaArray</command:noun> <maml:description> <maml:para>This function returns the object from an array within the Json Schema.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>This function returns the object from an array within the Json Schema. This function expands the array and returns a PowerShell representation of the object.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-SchemaArray</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>SchemaDocument</maml:name> <maml:Description> <maml:para>This should be the output of Get-SchemaDocument. For simple JSON schema's this could be passed along the pipeline to this function.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Object</command:parameterValue> <dev:type> <maml:name>Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>SchemaDocument</maml:name> <maml:Description> <maml:para>This should be the output of Get-SchemaDocument. For simple JSON schema's this could be passed along the pipeline to this function.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Object</command:parameterValue> <dev:type> <maml:name>Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Object</maml:name> </dev:type> <maml:description> <maml:para>This should always be the output of the Get-SchemaDocument function.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Object</maml:name> </dev:type> <maml:description> <maml:para>A PowerShell representation of the referenced schema</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> $SchemaDocument = 'https://gist.githubusercontent.com/jeffpatton1971/c2d3ee98a37766a2784ccd626b9b8ca2/raw/f2a92166f52e067542964216a7618b8d2c408489/array.json' |Get-SchemaDocument PS C:\> $SchemaDocument.properties.products |Get-SchemaArray price dimensions tags name ----- ---------- ---- ---- 0 {}</dev:code> <dev:remarks> <maml:para>This example reads in a Json schema from the internet and then passes in a specific array item within the schema.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Get-SchemaDocument</maml:linkText> <maml:uri>https://github.com/SchemaModule/PowerShell/blob/master/docs/Get-SchemaDocument.md#get-schemadocument</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <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"> <command:details> <command:name>Get-SchemaDocument</command:name> <command:verb>Get</command:verb> <command:noun>SchemaDocument</command:noun> <maml:description> <maml:para>This function will return a PowerShell object of the input Schema.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>This function will return a PowerShell object of the input Schema. This will help in building PowerShell objects that can be defined by a JSON schema. This allows a script to dynamically build objects based on a well-defined JSON schema.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-SchemaDocument</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>This can be a filepath or URL, the function does light validation on the input.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>This can be a filepath or URL, the function does light validation on the input.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para>A local or remote Json Schema file as defined by json-schema.org</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Object</maml:name> </dev:type> <maml:description> <maml:para>A PowerShell object representing the corresponding Json Schema</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> 'https://gist.githubusercontent.com/jeffpatton1971/c2d3ee98a37766a2784ccd626b9b8ca2/raw/a112c9119cce507c2b4e115c35afc6c26f63ffc7/schema.json' |Get-SchemaDocument $schema : http://json-schema.org/draft-07/schema $id : http://example.com/root.json type : object title : The Root Schema description : The root schema is the schema that comprises the entire JSON document. default : required : {checked, dimensions, id, name...} properties : @{checked=; dimensions=; id=; name=; price=; tags=}</dev:code> <dev:remarks> <maml:para>This example demonstrates passing a URL along the pipeline to the function.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>PS C:\> Get-SchemaDocument -Path D:\CODE\JSON\schema.json $schema : http://json-schema.org/draft-07/schema $id : http://example.com/root.json type : object title : The Root Schema description : The root schema is the schema that comprises the entire JSON document. default : required : {checked, dimensions, id, name...} properties : @{checked=; dimensions=; id=; name=; price=; tags=}</dev:code> <dev:remarks> <maml:para>This example passes a json schema file into the function.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>https://json-schema.org/</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <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"> <command:details> <command:name>Get-SchemaObject</command:name> <command:verb>Get</command:verb> <command:noun>SchemaObject</command:noun> <maml:description> <maml:para>This function returns an object from the Json Schema.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>This function returns an object from the Json Schema. By passing in a specific data structure and get back a PowerShell representation of the structure.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-SchemaObject</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>SchemaDocument</maml:name> <maml:Description> <maml:para>This should be the output of Get-SchemaDocument. For simple JSON schema's this could be passed along the pipeline to this function.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Object</command:parameterValue> <dev:type> <maml:name>Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>SchemaDocument</maml:name> <maml:Description> <maml:para>This should be the output of Get-SchemaDocument. For simple JSON schema's this could be passed along the pipeline to this function.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Object</command:parameterValue> <dev:type> <maml:name>Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Object</maml:name> </dev:type> <maml:description> <maml:para>This should always be the output of the Get-SchemaDocument function.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Object</maml:name> </dev:type> <maml:description> <maml:para>A PowerShell representation of the referenced schema</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> Get-SchemaObject -SchemaDocument $SchemaDocument price dimensions tags name ----- ---------- ---- ---- 0 {}</dev:code> <dev:remarks> <maml:para>This example shows how to pass in an object to the function.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>PS C:\> 'https://gist.githubusercontent.com/jeffpatton1971/c2d3ee98a37766a2784ccd626b9b8ca2/raw/a112c9119cce507c2b4e115c35afc6c26f63ffc7/schema.json' |Get-SchemaDocument |Get-SchemaObject price dimensions tags name ----- ---------- ---- ---- 0 {}</dev:code> <dev:remarks> <maml:para>A slightly more complex example, showing the ability to pass the schema along the pipeline to other functions.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Get-SchemaDocument</maml:linkText> <maml:uri>https://github.com/SchemaModule/PowerShell/blob/master/docs/Get-SchemaDocument.md#get-schemadocument</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <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"> <command:details> <command:name>Get-SchemaProperty</command:name> <command:verb>Get</command:verb> <command:noun>SchemaProperty</command:noun> <maml:description> <maml:para>This function returns one ore more properties from a Json Schema object.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>This function returns one ore more properties from a Json Schema object. This will allow you to view the detailed information of a given property from the Schema.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-SchemaProperty</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>SchemaDocument</maml:name> <maml:Description> <maml:para>This should be the output of Get-SchemaDocument. For simple JSON schema's this could be passed along the pipeline to this function.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Object</command:parameterValue> <dev:type> <maml:name>Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>The name of a property to return</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>The name of a property to return</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>SchemaDocument</maml:name> <maml:Description> <maml:para>This should be the output of Get-SchemaDocument. For simple JSON schema's this could be passed along the pipeline to this function.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Object</command:parameterValue> <dev:type> <maml:name>Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Object</maml:name> </dev:type> <maml:description> <maml:para>This should always be the output of the Get-SchemaDocument function.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Object</maml:name> </dev:type> <maml:description> <maml:para>A PowerShell representation of the referenced schema</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> $SchemaDocument.properties.products.items.anyOf |Get-SchemaProperty checked : @{$id=#/properties/products/items/anyOf/0/properties/checked; type=boolean; title=The checked schema; description=An explanation about the purpose of this instance.; default=False; examples=System.Object[]} dimensions : @{$id=#/properties/products/items/anyOf/0/properties/dimensions; type=object; title=The dimensions schema; description=An explanation about the purpose of this instance.; default=; examples=System.Object[]; required=System.Object[]; properties=; additionalProperties=True} id : @{$id=#/properties/products/items/anyOf/0/properties/id; type=integer; title=The id schema; description=An explanation about the purpose of this instance.; default=0; examples=System.Object[]} name : @{$id=#/properties/products/items/anyOf/0/properties/name; type=string; title=The name schema; description=An explanation about the purpose of this instance.; default=; examples=System.Object[]} price : @{$id=#/properties/products/items/anyOf/0/properties/price; type=number; title=The price schema; description=An explanation about the purpose of this instance.; default=0.0; examples=System.Object[]} tags : @{$id=#/properties/products/items/anyOf/0/properties/tags; type=array; title=The tags schema; description=An explanation about the purpose of this instance.; default=System.Object[]; examples=System.Object[]; additionalItems=True; items=}</dev:code> <dev:remarks> <maml:para>This example passes the schema object along the pipeline and returns all properties.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>PS C:\> Get-SchemaProperty -SchemaDocument $SchemaDocument.properties.products.items.anyOf -Name dimensions $id : #/properties/products/items/anyOf/0/properties/dimensions type : object title : The dimensions schema description : An explanation about the purpose of this instance. default : examples : {@{width=5; height=10}} required : {width, height} properties : @{width=; height=} additionalProperties : True</dev:code> <dev:remarks> <maml:para>This example passes the Schema into the function and references a specific named property to return.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Get-SchemaDocument</maml:linkText> <maml:uri>https://github.com/SchemaModule/PowerShell/blob/master/docs/Get-SchemaDocument.md#get-schemadocument</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> </helpItems> |