Skip to content

Fixing ABM DEP check bug #206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2025
Merged

Fixing ABM DEP check bug #206

merged 1 commit into from
Jul 24, 2025

Conversation

burrrble
Copy link
Contributor

@burrrble burrrble commented Jul 15, 2025

This statement results in the script failing.
if [ ! $? == 0 ]; then echo "$(date) | This device is not ABM managed" exit 0; else

Because of the single brackets, ZSH is invoking the history expansion operator ! instead of performing negation on the exit code check $? == 0

Using the double brackets fixes the problem and the script runs fine:
if [[ ! $? == 0 ]]; then echo "$(date) | This device is not ABM managed" exit 0; else

Double brackets aren't POSIX compliant, but I don't think it matters for this particular script?

@janparttimaa
Copy link
Contributor

@burrrble: Thanks, This was great catch! I also fixed this too on few other scripts as well.

@CKunze-MSFT CKunze-MSFT merged commit 97bf32d into microsoft:master Jul 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants