Skip to content

Commit

Permalink
Merge pull request #4899 from NikCharlebois/Tests-Improvements
Browse files Browse the repository at this point in the history
Improved performance of SPOSharingSettings
  • Loading branch information
NikCharlebois committed Jul 17, 2024
2 parents f585c37 + da07b43 commit 973a908
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10
* Initial release.
FIXES [#2659](https://github.com/microsoft/Microsoft365DSC/issues/2659)
* SPOSharingSettings
* Improved performance by using -Filter on Get-PnPTenantSite calls.
* M365DSCDRGUtil
* Fixes an issue with nested and duplicate settings in the settings catalog
* Add support for converting Intune assignments directly from Graph.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function Get-TargetResource
try
{
$SPOSharingSettings = Get-PnPTenant -ErrorAction Stop
$MySite = Get-PnPTenantSite | Where-Object { $_.Url -match '-my.sharepoint.' -and $_.Template -notmatch '^RedirectSite#' }
$MySite = Get-PnPTenantSite -Filter "Url -like '-my.sharepoint.' -and Template -notlike '^RedirectSite#'"

if ($null -ne $MySite)
{
Expand Down Expand Up @@ -532,7 +532,7 @@ function Set-TargetResource
Set-PnPTenant @CurrentParameters | Out-Null
if ($SetMySharingCapability)
{
$mysite = Get-PnPTenantSite | Where-Object { $_.Url -match '-my.sharepoint.com/' -and $_.Template -notmatch '^RedirectSite#' }
$mysite = Get-PnPTenantSite -Filter "Url -like '-my.sharepoint.' -and Template -notlike '^RedirectSite#'"
Set-PnPTenantSite -Identity $mysite.Url -SharingCapability $MySiteSharingCapability
}
}
Expand Down

0 comments on commit 973a908

Please sign in to comment.