diff --git a/CHANGELOG.md b/CHANGELOG.md index d05083b06b..99c1a56562 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ FIXES [#3035](https://github.com/microsoft/Microsoft365DSC/issues/3035) * Deprecated all FontName properties, since these are no longer configurable. FIXES [#3035](https://github.com/microsoft/Microsoft365DSC/issues/3035) + * Fixed the collection of new and set parameters to ensure the correct values are passed to the New/Set cmdlets. + FIXES [#3050](https://github.com/microsoft/Microsoft365DSC/issues/3050) * MISC * Added QA test that checks for existence of an example for each resource. * DRG diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCSensitivityLabel/MSFT_SCSensitivityLabel.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCSensitivityLabel/MSFT_SCSensitivityLabel.psm1 index 4ada9240ec..7f1766f797 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCSensitivityLabel/MSFT_SCSensitivityLabel.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCSensitivityLabel/MSFT_SCSensitivityLabel.psm1 @@ -837,11 +837,20 @@ function Set-TargetResource $CreationParams.Remove('SiteAndGroupExternalSharingControlType') } - $CreationParams.Remove('Credential') | Out-Null - $CreationParams.Remove('Ensure') | Out-Null $CreationParams.Remove('Priority') | Out-Null $CreationParams.Remove('Disabled') | Out-Null + # Remove authentication parameters + $CreationParams.Remove('Ensure') | Out-Null + $CreationParams.Remove('Credential') | Out-Null + $CreationParams.Remove('ApplicationId') | Out-Null + $CreationParams.Remove('TenantId') | Out-Null + $CreationParams.Remove('CertificatePath') | Out-Null + $CreationParams.Remove('CertificatePassword') | Out-Null + $CreationParams.Remove('CertificateThumbprint') | Out-Null + $CreationParams.Remove('ManagedIdentity') | Out-Null + $CreationParams.Remove('ApplicationSecret') | Out-Null + try { Write-Verbose -Message "Creating Label {$Name}" @@ -878,11 +887,20 @@ function Set-TargetResource } #Remove unused parameters for Set-Label cmdlet - $SetParams.Remove('Credential') | Out-Null - $SetParams.Remove('Ensure') | Out-Null $SetParams.Remove('Name') | Out-Null $SetParams.Remove('Disabled') | Out-Null + # Remove authentication parameters + $SetParams.Remove('Ensure') | Out-Null + $SetParams.Remove('Credential') | Out-Null + $SetParams.Remove('ApplicationId') | Out-Null + $SetParams.Remove('TenantId') | Out-Null + $SetParams.Remove('CertificatePath') | Out-Null + $SetParams.Remove('CertificatePassword') | Out-Null + $SetParams.Remove('CertificateThumbprint') | Out-Null + $SetParams.Remove('ManagedIdentity') | Out-Null + $SetParams.Remove('ApplicationSecret') | Out-Null + try { Set-Label @SetParams -Identity $Name