I created a pretty generic script to run defaults commands with the intention that the arguments would do all the work. If I create a policy that has that script specified several times, every instance of the script uses the arguments of the first one. I would've thought that if I added a script several times that it would let me specify different arguments.
Is this a bug?
Try to create ingremented duplicates of the script you want to run twice or more times in a policy. Something like
I heard something about this bug some time ago, but not that shure.
As far as I know it's always behaved like this, there is almost certainly a feature request around somewhere asking for it to be changed.
Rather than having several seperate scripts it's probably cleaner and easier to have linked policies (or sequentially named ones).
You can create several policies each with the script with different arguments all set to the same custom trigger, you make one
jamf policy -event "CUSTOMTRIGGER"
call from a main policy.
There's lots of ways around this problem but I'm striving to keep my policy list as short as possible, and having multiple policies that really should be one just makes it a mess. It also cripples the power of generalized scripts.