This PR introduces a new property, NoPropertyName, for the Write-PodeXmlResponse cmdlet. This property modifies the XML output structure by removing the Property elements and using the property names directly within the XML structure.
Changes
New Property:
Added the NoPropertyName property to Write-PodeXmlResponse.
New Function:ConvertTo-PodeXml
The ConvertTo-PodeXml function takes input objects, either from the pipeline or as an array of objects,
and converts them into XML format. This function supports converting hashtables and PSObjects, and it
can handle multiple objects inputted via the pipeline.
Write-PodeXmlResponse is using ConvertTo-PodeXml
Note
HashTable is managed differently from PSObject. Hashtable always returns a string with no properties.
This behavior is more in sync with the restful way than ConvertTo-Xml.
ConvertTo-Xml is excellent for SOAP, not for Restful.
Benefits
Simplified XML Structure:
The new XML output format is more streamlined and more straightforward to read by directly including property names and their values, eliminating the intermediate Property elements.
Summary
This PR introduces a new property,
NoPropertyName
, for theWrite-PodeXmlResponse
cmdlet. This property modifies the XML output structure by removing theProperty
elements and using the property names directly within the XML structure.Changes
New Property:
NoPropertyName
property toWrite-PodeXmlResponse
.New Function:
ConvertTo-PodeXml
The ConvertTo-PodeXml function takes input objects, either from the pipeline or as an array of objects, and converts them into XML format. This function supports converting hashtables and PSObjects, and it can handle multiple objects inputted via the pipeline.Write-PodeXmlResponse
is usingConvertTo-PodeXml
Note
HashTable is managed differently from PSObject. Hashtable always returns a string with no properties. This behavior is more in sync with the restful way than
ConvertTo-Xml
.ConvertTo-Xml
is excellent for SOAP, not for Restful.Benefits
Property
elements.Implementation Details
Default XML Output:
New XML Output with
NoPropertyName
:Usage
To enable the new
NoPropertyName
feature, set the property to$true
when callingWrite-PodeXmlResponse
: