I'm trying to create a policy which runs a script. I want the script to check the OS version installed and depending on if it's running a version that is High Sierra or lower than High Sierra, I want it to install a pkg. I'm limited in my scripting skills, so hopefully I can get some guidance.
Here's what I have so far:
I can get the version installed by running:
defaults read loginwindow SystemVersionStampAsString
Then, I have the 2 pkg's with a custom trigger. I just need to figure out how to run a specific pkg depending on what OS the computer is running. I suppose I can restrict it by excluding certain OS's on the 2 policies, but thought it might be cleaner/simpler to put it into a script. Perhaps I'm overthinking this?
Thanks for any help!