From 195142a591022191ea0b97a808e337dfb1b6cb43 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Fri, 19 Jan 2024 08:12:57 -0500 Subject: [PATCH] Fixes for SPOSharingSettings --- CHANGELOG.md | 3 +++ .../MSFT_SPOSharingSettings.psm1 | 4 +++ .../3-Remove.ps1 | 26 ------------------- 3 files changed, 7 insertions(+), 26 deletions(-) delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/3-Remove.ps1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 78bafaa588..bad7eb5a77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,9 @@ * Removed the ability to specify a value of Absent for the Ensure property. * AADCrossTenantAccessPolicyCOnfigurationDefault * Removed the ability to specify a value of Absent for the Ensure property. +* SPOSharingSettings + * Fixed an Issue where the MySiteSharingCapability could be returned as an + empty string instead of a null value from the Get method. # 1.24.117.1 diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 index a60538c49d..33916b54fb 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 @@ -194,6 +194,10 @@ function Get-TargetResource $DefaultLinkPermission = $SPOSharingSettings.DefaultLinkPermission } + if ([System.String]::IsNullOrEmpty($MySiteSharingCapability)) + { + $MySiteSharingCapability = $null + } return @{ IsSingleInstance = 'Yes' SharingCapability = $SPOSharingSettings.SharingCapability diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/3-Remove.ps1 deleted file mode 100644 index 6ca6f1913c..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/3-Remove.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyEmail "AADAuthenticationMethodPolicyEmail-Email" - { - Ensure = "Absent"; - Id = "Email"; - State = "disabled"; # Updated Property - Credential = $credsCredential; - } - } -}