Skip to content

Commit

Permalink
Merge pull request #2267 from NikCharlebois/AADRoleSetting-Export-Fix
Browse files Browse the repository at this point in the history
Fixes for ADRoleSetting Export
  • Loading branch information
NikCharlebois authored Sep 9, 2022
2 parents 01ef93a + 734c9bd commit c94ea58
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change log for Microsoft365DSC

# UNRELEASED

* AADRoleSetting
* Fixed an issue where the export wasn't properly passing credential to the Get function.

# 1.22.907.1

* EXODistributionGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ function Get-TargetResource
-InboundParameters $PSBoundParameters `
-ProfileName 'beta'

Select-MgProfile -Name 'beta'
$MaximumFunctionCount = 32000

Write-Verbose -Message "Getting configuration of Role"
Expand Down Expand Up @@ -1254,6 +1253,7 @@ function Export-TargetResource
ApplicationId = $ApplicationId
TenantId = $TenantId
CertificateThumbprint = $CertificateThumbprint
Credential = $Credential
}
$Results = Get-TargetResource @Params
$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
Expand Down
11 changes: 6 additions & 5 deletions Modules/Microsoft365DSC/Modules/M365DSCReverse.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -783,15 +783,16 @@ function Get-M365DSCResourcesByWorkloads
$Mode = 'Default'
)

Write-Host "Finding all resources for workload {$Workload} and Mode {$Mode}" -ForegroundColor Gray

$modules = Get-ChildItem -Path ($PSScriptRoot + "\..\DSCResources\") -Recurse -Filter '*.psm1'
$Components = @()
foreach ($resource in $modules)
foreach ($Workload in $Workloads)
{
$ResourceName = $resource.Name -replace "MSFT_", "" -replace ".psm1", ""
foreach ($Workload in $Workloads)
Write-Host "Finding all resources for workload {$Workload} and Mode {$Mode}" -ForegroundColor Gray

foreach ($resource in $modules)
{
$ResourceName = $resource.Name -replace "MSFT_", "" -replace ".psm1", ""

if ($ResourceName.StartsWith($Workload, 'CurrentCultureIgnoreCase') -and
($Mode -eq "Full" -or `
($Mode -eq "Default" -and -not $Global:FullComponents.Contains($ResourceName)) -or `
Expand Down

0 comments on commit c94ea58

Please sign in to comment.