I am preparing a script (based on the famous CasperCheck by @rtrouton) to ensure devices are correctly enrolled and fix them if something is missing.
However, I keep getting an error when the script runs this line:
jamf enroll -invitation $invitationCode -noRecon -noPolicy
The enrollment in fact goes well, and the the device ends up working as expected, but I get the following error:
7170 Illegal instruction: 4 jamf enroll -invitation $invitationCode -noRecon -noPolicy
Strangely, if I run the command on the Terminal, I don't get the error.
I've checked here and there, and it seems that the error is more related to dylibs that the script, of course, is not touching.
Has any of you came across this kind of problem?