I've been writing a lot of custom scripts to be used with PRTG in the past years. Most of these were written in Powershell. A few months ago, I started playing with Python scripts in PRTG and I noticed there's a CustomSensorResult class available which makes outputting the correct JSON Format a piece of cake.
So I started to study that class and finally ended up in creating a similar class to be used in PowerShell scripts. It is still a work in progress, but the current version can already be used except for the limit (warning/error) options on channels.
More information can be found on https://itpro.peene.be/prtg-powershell-class-for-custom-sensor-results/
Feel free to use it. I'll be happy to hear your comments.