Summary of the new feature / enhancement
Currently, the ConvertTo-Json cmdlet assembles all input objects into an in-memory List, then converts that to one Json string for output. This can be inefficient if there are many input objects.
Enhancing ConvertTo-Json to (optionally) convert each input object to a complete Json string and output
as it is processed offers these benefits:
- reduced memory usage
- substantially improved throughput when the output stream is being processed by a separate thread
or process.
Proposed technical implementation details (optional)
Add an AsStream parameter to the cmdlet and modify the code to convert and output each object individually.
Summary of the new feature / enhancement
Currently, the ConvertTo-Json cmdlet assembles all input objects into an in-memory List, then converts that to one Json string for output. This can be inefficient if there are many input objects.
Enhancing ConvertTo-Json to (optionally) convert each input object to a complete Json string and output
as it is processed offers these benefits:
or process.
Proposed technical implementation details (optional)
Add an AsStream parameter to the cmdlet and modify the code to convert and output each object individually.