Skip to content

Normalize detection type handling in New-IntuneDetectionMethod function - #46

Open
langermi wants to merge 1 commit into
byteben:mainfrom
langermi:main
Open

Normalize detection type handling in New-IntuneDetectionMethod function#46
langermi wants to merge 1 commit into
byteben:mainfrom
langermi:main

Conversation

@langermi

Copy link
Copy Markdown

This pull request makes several improvements to the New-IntuneDetectionMethod function in Private/New-IntuneDetection.ps1, focusing on normalizing detection type handling and correcting logic for special detection cases. The main changes enhance consistency and robustness when processing detection types and operators.

Detection type normalization and logic fixes:

  • Ensured detection type values are always normalized to lowercase before further processing, preventing case-sensitivity bugs.
  • Updated the detection type switch-case to match on lowercase 'int64' instead of 'Int64', aligning with the normalization step.

Special case handling:

  • Improved the logic for handling "exists" file/folder checks by:
    • Correcting the operator comparison from 'notEquals' to 'notEqual' for consistency with expected input.
    • Adding a condition to handle cases where the detection type is missing or empty, defaulting to an "exists" check.

…on - Uploading Apps with "File or Folder" dedection type now works when no Operator was set
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.

1 participant