Skip to content

Commit

Permalink
Merge pull request #2651 from NikCharlebois/FIXES#2466
Browse files Browse the repository at this point in the history
Fixes #2466
  • Loading branch information
NikCharlebois authored Dec 9, 2022
2 parents a2068be + ccbf031 commit a31a61b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
* SCRetentionComplianceRule
* Fixed an Issue where properties weren't properly set at creation, causing drifts to be detected.
FIXES [#2471](https://github.com/microsoft/Microsoft365DSC/issues/2471)
* SPOTenantCdnEnabled
* Fixed an issue where the export wasn't returning anything if the CDN was not enabled.
FIXES [#2466](https://github.com/microsoft/Microsoft365DSC/issues/2466)
* SPOUserProfileProperty
* Removed multi-threading to align with other resources.
* Fixed an issue where we were contacting Microsoft Graph to retrieve users without authenticating to it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ function Get-TargetResource
$ConnectionMode = New-M365DSCConnection -Workload 'PNP' `
-InboundParameters $PSBoundParameters

$nullResult = $PSBoundParameters
$nullResult.Ensure = 'Absent'

#Ensure the proper dependencies are installed in the current environment.
Confirm-M365DSCDependencies

Expand Down Expand Up @@ -101,7 +104,7 @@ function Get-TargetResource
throw $_
}

return @{}
return $nullResult
}
}

Expand Down Expand Up @@ -355,19 +358,16 @@ function Export-TargetResource

$Results = Get-TargetResource @Params
Write-Host " |---[$i/2] $cType" -NoNewline
if ($Results.Enable -eq $True)
{
$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
-Results $Results
$currentDSCBlock = Get-M365DSCExportContentForResource -ResourceName $ResourceName `
-ConnectionMode $ConnectionMode `
-ModulePath $PSScriptRoot `
-Results $Results `
-Credential $Credential
$dscContent += $currentDSCBlock
Save-M365DSCPartialExport -Content $currentDSCBlock `
-FileName $Global:PartialExportFileName
}
$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
-Results $Results
$currentDSCBlock = Get-M365DSCExportContentForResource -ResourceName $ResourceName `
-ConnectionMode $ConnectionMode `
-ModulePath $PSScriptRoot `
-Results $Results `
-Credential $Credential
$dscContent += $currentDSCBlock
Save-M365DSCPartialExport -Content $currentDSCBlock `
-FileName $Global:PartialExportFileName
$i++
Write-Host $Global:M365DSCEmojiGreenCheckmark
}
Expand Down

0 comments on commit a31a61b

Please sign in to comment.