Skip to content

Commit

Permalink
Merge pull request #2872 from ykuijs/Bugfix
Browse files Browse the repository at this point in the history
Bugfix
  • Loading branch information
NikCharlebois authored Feb 7, 2023
2 parents 296250b + 507ed4a commit e359632
Show file tree
Hide file tree
Showing 42 changed files with 1,240 additions and 870 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
"powershell.codeFormatting.autoCorrectAliases": true,
"powershell.codeFormatting.useCorrectCasing": true,
"powershell.codeFormatting.openBraceOnSameLine": false,
"powershell.codeFormatting.newLineAfterOpenBrace": false,
"powershell.codeFormatting.newLineAfterOpenBrace": true,
"powershell.codeFormatting.newLineAfterCloseBrace": true,
"powershell.codeFormatting.trimWhitespaceAroundPipe": true,
"powershell.codeFormatting.whitespaceBeforeOpenBrace": true,
"powershell.codeFormatting.whitespaceBeforeOpenParen": true,
"powershell.codeFormatting.whitespaceAroundOperator": true,
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# 1.23.201.1

* IntuneDeviceCompliancePolicyWindows10
* Updated example
* IntuneDeviceConfigurationPolicyWindows10
* Updated example
* PlannerTask
* Fixed issue where Attachments Uri weren't properly exiting single quotes.
FIXES [#2822](https://github.com/microsoft/Microsoft365DSC/issues/2822)
Expand All @@ -22,6 +26,12 @@
* DEPENDENCIES
* Updated Microsoft.Graph.* to version 1.21.0
* Updated MicrosoftTeams to version 4.9.3
* MISC
* Corrected Ensure parameter logic for many resources.
Removed requirement for Ensure=Present only.
FIXES [#2718](https://github.com/microsoft/Microsoft365DSC/issues/2718)
* Updated documentation to reflect new authentication possibilities
FIXES [#2863](https://github.com/microsoft/Microsoft365DSC/issues/2863)

# 1.23.125.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,37 @@ function Get-TargetResource
Add-M365DSCTelemetryEvent -Data $data
#endregion

$nullReturn = @{
IsSingleInstance = 'Yes'
}

try
{
$Policy = Get-MgPolicyAuthorizationPolicy -ErrorAction Stop
}
catch
{
Write-Verbose -Message "Couldn't find existing authorization policy"
throw "Cannot retrieve authorization policy, $($_.Exception.Message)"
$message = 'Could not find existing authorization policy'

New-M365DSCLogEntry -Message $message `
-Exception $_ `
-Source $($MyInvocation.MyCommand.Source) `
-TenantId $TenantId `
-Credential $Credential

return $nullReturn
}

if ($null -eq $Policy)
{
Write-Verbose -Message 'Existing Authorization Policy was not found'
throw 'authorization policy was not found'
$message = 'Existing Authorization Policy was not found'

New-M365DSCLogEntry -Message $message `
-Source $($MyInvocation.MyCommand.Source) `
-TenantId $TenantId `
-Credential $Credential

return $nullReturn
}
else
{
Expand Down Expand Up @@ -513,21 +530,38 @@ function Export-TargetResource

try
{
$results = Get-TargetResource -IsSingleInstance 'Yes' @PSBoundParameters
$dscContent = ''

Write-Host "`r`n" -NoNewline
Write-Host " |---[1/1] $($results.DisplayName)" -NoNewline
$results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
-Results $results
$currentDSCBlock = Get-M365DSCExportContentForResource -ResourceName $ResourceName `
-ConnectionMode $ConnectionMode `
-ModulePath $PSScriptRoot `
-Results $results `
-Credential $Credential
Save-M365DSCPartialExport -Content $currentDSCBlock `
-FileName $Global:PartialExportFileName
Write-Host $Global:M365DSCEmojiGreenCheckMark
$params = @{
IsSingleInstance = 'Yes'
Credential = $Credential
ApplicationId = $ApplicationId
TenantId = $TenantId
CertificateThumbprint = $CertificateThumbprint
ManagedIdentity = $ManagedIdentity
}
$Results = Get-TargetResource @Params

if ($Results -is [System.Collections.Hashtable] -and $Results.Count -gt 1)
{
Write-Host "`r`n" -NoNewline
Write-Host " |---[1/1] $($results.DisplayName)" -NoNewline
$results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
-Results $results
$currentDSCBlock = Get-M365DSCExportContentForResource -ResourceName $ResourceName `
-ConnectionMode $ConnectionMode `
-ModulePath $PSScriptRoot `
-Results $results `
-Credential $Credential
Save-M365DSCPartialExport -Content $currentDSCBlock `
-FileName $Global:PartialExportFileName

Write-Host $Global:M365DSCEmojiGreenCheckMark
}
else
{
Write-Host $Global:M365DSCEmojiRedX
}

return $currentDSCBlock
}
Expand All @@ -540,6 +574,7 @@ function Export-TargetResource
-Source $($MyInvocation.MyCommand.Source) `
-TenantId $TenantId `
-Credential $Credential

return ''
}
}
Expand Down
Loading

0 comments on commit e359632

Please sign in to comment.