From e4bbb55d4b08e0a01e7eb0330b6843681ed493ea Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Tue, 16 Jan 2024 12:28:51 -0500 Subject: [PATCH] Fixes Integration Tests --- .../MSFT_AADAuthenticationMethodPolicyX509.psm1 | 8 +++----- .../AADAuthenticationMethodPolicyX509/1-Create.ps1 | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyX509/MSFT_AADAuthenticationMethodPolicyX509.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyX509/MSFT_AADAuthenticationMethodPolicyX509.psm1 index 80d6cfdef0..bf924124db 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyX509/MSFT_AADAuthenticationMethodPolicyX509.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyX509/MSFT_AADAuthenticationMethodPolicyX509.psm1 @@ -4,7 +4,6 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - #region resource generator code [Parameter()] [Microsoft.Management.Infrastructure.CimInstance] $AuthenticationModeConfiguration, @@ -30,8 +29,6 @@ function Get-TargetResource [System.String] $Id, - #endregion - [Parameter()] [System.String] [ValidateSet('Absent', 'Present')] @@ -118,7 +115,8 @@ function Get-TargetResource $complexAuthenticationModeConfiguration.Add('Rules', $complexRules) } } - else { + else + { $complexAuthenticationModeConfiguration.Add('Rules', @('')) } @@ -392,7 +390,7 @@ function Set-TargetResource #region resource generator code $UpdateParameters.Add('@odata.type', '#microsoft.graph.x509CertificateAuthenticationMethodConfiguration') Write-Verbose -Message "Updating with Values: $(Convert-M365DscHashtableToString -Hashtable $UpdateParameters)" - Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration ` + Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration ` -AuthenticationMethodConfigurationId $currentInstance.Id ` -BodyParameter $UpdateParameters #endregion diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyX509/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyX509/1-Create.ps1 index 79bed26790..5916e2a1e6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyX509/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyX509/1-Create.ps1 @@ -19,6 +19,7 @@ Configuration Example { AuthenticationModeConfiguration = MSFT_MicrosoftGraphx509CertificateAuthenticationModeConfiguration{ X509CertificateAuthenticationDefaultMode = 'x509CertificateSingleFactor' + Rules = @() }; CertificateUserBindings = @( MSFT_MicrosoftGraphx509CertificateUserBinding{