Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Private/New-IntuneDetection.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function New-IntuneDetectionMethod {

# Prepare detection types for the Intune detection method
switch ($detectionType) {
'Int64' {
'int64' {
$detectionType = 'integer'
}
}
Expand Down Expand Up @@ -168,8 +168,10 @@ function New-IntuneDetectionMethod {
$check32BitOn64System = [bool]$true
}

# Set the detection type
$detectionType = $detectionType.ToLower()
# Set and normalize the detection type when provided
if (-not [string]::IsNullOrWhiteSpace($detectionType)) {
$detectionType = $detectionType.ToLower()
}

# Prepare operands for the Intune detection method
switch ($operator) {
Expand Down Expand Up @@ -211,8 +213,8 @@ function New-IntuneDetectionMethod {
}
}

# Check detection types
if ($operator -eq 'notEquals' -and $detectionValue -eq 0 -and $detectionType -eq 'int64') {
# "Exists" file/folder checks from MECM can come through as NotEquals + Int64 + 0
if (($operator -eq 'notEqual' -and $detectionValue -eq 0 -and $detectionType -eq 'int64') -or [string]::IsNullOrWhiteSpace($detectionType)) {
$operator = 'notConfigured'
$detectionType = 'exists'
$detectionValue = $null
Expand Down