Skip to content

Commit

Permalink
Merge pull request #5471 from FabienTschanz/fix/mobile-threat-defense…
Browse files Browse the repository at this point in the history
…-connector

Fix NotFound error on Get and comparison
  • Loading branch information
NikCharlebois authored Nov 27, 2024
2 parents d3f0e86 + 84a6fc0 commit c9b59e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
* Fixes an issue where assignment wasn't properly set if the
groupId was null.
FIXES [#5430](https://github.com/microsoft/Microsoft365DSC/issues/5430)
* IntuneMobileThreatDefenseConnector
* Fixes a NotFound error when the resource does not exist and remove
`LastHeartbeatDateTime` from comparison.
* IntuneRoleAssignment
* Improve verbose output and fix copy-pasted variables.
* IntuneRoleScopeTag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function Get-TargetResource
}
else
{
$instance = Get-MgBetaDeviceManagementMobileThreatDefenseConnector -MobileThreatDefenseConnectorId $Id -ErrorAction Stop
$instance = Get-MgBetaDeviceManagementMobileThreatDefenseConnector -MobileThreatDefenseConnectorId $Id -ErrorAction SilentlyContinue
}

if ($null -eq $instance)
Expand Down Expand Up @@ -489,6 +489,7 @@ function Test-TargetResource

$CurrentValues = Get-TargetResource @PSBoundParameters
$ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone()
$ValuesToCheck.Remove('LastHeartbeatDateTime') | Out-Null

Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $ValuesToCheck)"
Expand Down

0 comments on commit c9b59e1

Please sign in to comment.