Apple Configuration Profile Reference
https://developer.apple.com/business/documentation/Configuration-Profile-Reference.pdf
#!/bin/sh
########## variable-ing ##########
kextList=$(/usr/sbin/kextstat -l | /usr/bin/grep -v 'com.apple' | /usr/bin/awk '{print $6}' | /usr/bin/sort)
########## main process ##########
# Report result.
echo "<result>$kextList</result>"
exit 0
Link:
https://github.com/palantir/jamf-pro-scripts/blob/4672e65091a0684ef9