I worked this out and can be used in a policy. Hope this helps someone out
#!/bin/bash
### Environment Variables ###
# For OS updates use OSXUpd
# For Security updates use SecUpd
# Get any OS updates
getosupd=$(softwareupdate -l | grep OSXupd | awk 'NR==1 {print $2}')
#Get any security updates
getsecupd=$(softwareupdate -l | grep SecUpd | awk 'NR==1 {print $2}')
### DO NOT MODIFY BELOW THIS LINE ###
# Install OS updates
softwareupdate -i $getosupd
# Install Security updates
softwareupdate -i $getsecupd
exit 0
~
~