Skip to content

Commit

Permalink
Update MSFT_IntuneTrustedRootCertificateIOS.psm1
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyKBjj committed Nov 26, 2024
1 parent a827cf3 commit 12e73af
Showing 1 changed file with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,21 +242,13 @@ function Set-TargetResource
#endregion

$currentInstance = Get-TargetResource @PSBoundParameters

$PSBoundParameters.Remove('Ensure') | Out-Null
$PSBoundParameters.Remove('Credential') | Out-Null
$PSBoundParameters.Remove('ApplicationId') | Out-Null
$PSBoundParameters.Remove('ApplicationSecret') | Out-Null
$PSBoundParameters.Remove('TenantId') | Out-Null
$PSBoundParameters.Remove('CertificateThumbprint') | Out-Null
$PSBoundParameters.Remove('ManagedIdentity') | Out-Null
$PSBoundParameters.Remove('AccessTokens') | Out-Null
$BoundParameters = Remove-M365DSCAuthenticationParameter -BoundParameters $PSBoundParameters

if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent')
{
Write-Verbose -Message "Creating {$DisplayName}"
$PSBoundParameters.Remove('Assignments') | Out-Null
$CreateParameters = ([Hashtable]$PSBoundParameters).clone()
$BoundParameters.Remove('Assignments') | Out-Null
$CreateParameters = ([Hashtable]$BoundParameters).clone()
$CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters
$AdditionalProperties = Get-M365DSCAdditionalProperties -Properties ($CreateParameters)

Expand All @@ -275,7 +267,6 @@ function Set-TargetResource
}

$CreateParameters.Remove('Id') | Out-Null
$CreateParameters.Remove('Verbose') | Out-Null

foreach ($key in ($CreateParameters.clone()).Keys)
{
Expand All @@ -302,8 +293,8 @@ function Set-TargetResource
elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present')
{
Write-Verbose -Message "Updating {$DisplayName}"
$PSBoundParameters.Remove('Assignments') | Out-Null
$UpdateParameters = ([Hashtable]$PSBoundParameters).clone()
$BoundParameters.Remove('Assignments') | Out-Null
$UpdateParameters = ([Hashtable]$BoundParameters).clone()
$UpdateParameters = Rename-M365DSCCimInstanceParameter -Properties $UpdateParameters
$AdditionalProperties = Get-M365DSCAdditionalProperties -Properties ($UpdateParameters)

Expand All @@ -322,7 +313,6 @@ function Set-TargetResource
}

$UpdateParameters.Remove('Id') | Out-Null
$UpdateParameters.Remove('Verbose') | Out-Null

foreach ($key in ($UpdateParameters.clone()).Keys)
{
Expand Down Expand Up @@ -480,7 +470,9 @@ function Test-TargetResource
$ValuesToCheck.Remove($key) | Out-Null
}
}

$ValuesToCheck.Remove('Id') | Out-Null
$ValuesToCheck = Remove-M365DSCAuthenticationParameter -BoundParameters $ValuesToCheck

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

0 comments on commit 12e73af

Please sign in to comment.