Skip to content

Commit

Permalink
Merge branch 'Dev' into fix/credential-export
Browse files Browse the repository at this point in the history
  • Loading branch information
FabienTschanz committed Feb 14, 2025
2 parents 63d1889 + ebbbf1c commit 520caa5
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 61 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
# UNRELEASED

* M365DSCUtil
* Add M365DSC prefix to `Remove-EmptyValue`.
* Fixes an issue with `Credential` property being escaped and indentation.
* Adds the possibility to allow variables in strings and no authentication
results update during conversion to final export.
results update during conversion to final export.
FIXES [#3861](https://github.com/microsoft/Microsoft365DSC/issues/3861)
* TeamsAppPermissionPolicy
* Updated correct Typecasting for AppPresetMeeting and PinnedMessagebarApps before adding them to the policy
FIXES [[#5752](https://github.com/microsoft/Microsoft365DSC/issues/5752)

# 1.25.212.2

Expand All @@ -29,6 +34,7 @@
* EXOSmtpDaneInbound
* Updated authentication properties to align with MOF definition.
FIXES [#5709](https://github.com/microsoft/Microsoft365DSC/issues/5709)

* MISC
* PowerPlatform resource revamp to use direct REST API calls.
* Simplify export behavior for all resources and complex objects.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ function Set-TargetResource
Confirm = $false
}
# Removes empty properties from Splat to prevent function throwing errors if parameter is null or empty
Remove-EmptyValue -Splat $NewOrganizationRelationshipParams
Remove-M365DSCEmptyValue -Splat $NewOrganizationRelationshipParams

$SetOrganizationRelationshipParams = @{
ArchiveAccessEnabled = $ArchiveAccessEnabled
Expand All @@ -454,7 +454,7 @@ function Set-TargetResource
Confirm = $false
}
# Removes empty properties from Splat to prevent function throwing errors if parameter is null or empty
Remove-EmptyValue -Splat $SetOrganizationRelationshipParams
Remove-M365DSCEmptyValue -Splat $SetOrganizationRelationshipParams

# CASE: Organization Relationship doesn't exist but should;
if ($Ensure -eq 'Present' -and $currentOrgRelationshipConfig.Ensure -eq 'Absent')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1007,15 +1007,6 @@ function Get-M365DSCPowerPlatformTenantSettings
catalogSettings = @{
powerCatalogAudienceSetting = $Parameters.PowerCatalogAudienceSetting
}
governance = @{
disableAdminDigest = $Parameters.DisableAdminDigest
disableDeveloperEnvironmentCreationByNonAdminUsers = $Parameters.DisableDeveloperEnvironmentCreationByNonAdminUsers
enableDefaultEnvironmentRouting = $Parameters.EnableDefaultEnvironmentRouting
policy = @{
enableDesktopFlowDataPolicyManagement = [Boolean]::Parse($Parameters.EnableDesktopFlowDataPolicyManagement)
}
environmentRoutingAllMakers = $Parameters.EnvironmentRoutingAllMakers
}
environments = @{
disablePreferredDataLocationForTeamsEnvironment = $Parameters.DisablePreferredDataLocationForTeamsEnvironment
}
Expand Down Expand Up @@ -1075,6 +1066,29 @@ function Get-M365DSCPowerPlatformTenantSettings
}
}

$governance = @{
disableAdminDigest = $Parameters.DisableAdminDigest
disableDeveloperEnvironmentCreationByNonAdminUsers = $Parameters.DisableDeveloperEnvironmentCreationByNonAdminUsers
enableDefaultEnvironmentRouting = $Parameters.EnableDefaultEnvironmentRouting
environmentRoutingAllMakers = $Parameters.EnvironmentRoutingAllMakers
}

if ($null -ne $EnableDesktopFlowDataPolicyManagement)
{
try
{
$policy = @{
enableDesktopFlowDataPolicyManagement = [Boolean]::Parse($Parameters.EnableDesktopFlowDataPolicyManagement)
}
$governance.Add('policy', $policy)
}
catch
{
Write-Verbose -Message $_
}
}
$result.powerplatform.Add('governance', $governance)

return $result
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function Set-TargetResource
{
foreach ($appInstance in $AppPresetMeetingList)
{
$appPresetMeetingValues += [Microsoft.Teams.Policy.Administration.Cmdlets.Core.AppPreset]::New($appInstance)
$appPresetMeetingValues += [Microsoft.Teams.Policy.Administration.Cmdlets.Core.AppPresetMeeting]::New($appInstance)
}
}

Expand All @@ -251,7 +251,7 @@ function Set-TargetResource
$i = 1
foreach ($appInstance in $PinnedMessageBarApps)
{
$pinnedMessageBarAppsValue += [Microsoft.Teams.Policy.Administration.Cmdlets.Core.PinnedApp]::New($appInstance, $i)
$pinnedMessageBarAppsValue += [Microsoft.Teams.Policy.Administration.Cmdlets.Core.PinnedMessageBarApp]::New($appInstance, $i)
$i++
}
}
Expand Down
26 changes: 4 additions & 22 deletions Modules/Microsoft365DSC/Microsoft365DSC.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
#
# Generated by: Microsoft Corporation
#
# Generated on: 2025-02-12
# Generated on: 2025-02-13

@{

# Script module or binary module file associated with this manifest.
# RootModule = ''

# Version number of this module.
ModuleVersion = '1.25.212.1'
ModuleVersion = '1.25.212.2'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -149,26 +149,8 @@
IconUri = 'https://github.com/microsoft/Microsoft365DSC/blob/Dev/Modules/Microsoft365DSC/Dependencies/Images/Logo.png?raw=true'

# ReleaseNotes of this module
ReleaseNotes = '* AADApplication
* Changing the AuthenticationBehaviors parameters to string to allow
for null values.
* AADCrossTenantAccessPolicyConfigurationDefault
* Fixes an issue with CIM class export.
* AADCrossTenantAccessPolicyConfigurationPartner
* Fixes an issue with CIM class export.
FIXES [#5711](https://github.com/microsoft/Microsoft365DSC/issues/5711)
* EXORetentionPolicyTag
* Initial release.
* EXOSmtpDaneInbound
* Updated authentication properties to align with MOF definition.
FIXES [#5709](https://github.com/microsoft/Microsoft365DSC/issues/5709)
* MISC
* PowerPlatform resource revamp to use direct REST API calls.
* Simplify export behavior for all resources and complex objects.
* DEPENDENCIES
* Removed dependency on Microsoft.PowerApps.Administration.PowerShell.
* Updated MSCloudLoginAssistant to version 1.1.37.
* Updated ReverseDSC to version 2.0.0.25.'
ReleaseNotes = '* MISC
* Fixing connection errors in Power Platforms resources.'

# Flag to indicate whether the module requires explicit user acceptance for install/update
# RequireLicenseAcceptance = $false
Expand Down
4 changes: 3 additions & 1 deletion Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ function Get-M365DSCDRGComplexTypeToString
{
$currentProperty = @()
$IndentLevel++
for($i = 0; $i -lt $ComplexObject.Count; $i++)
for ($i = 0; $i -lt $ComplexObject.Count; $i++)
{
$item = $ComplexObject[$i]
$splat = @{
Expand Down Expand Up @@ -413,6 +413,8 @@ function Get-M365DSCDRGComplexTypeToString
}
if ($i -ne 0)
{
# Remove the line break at the start because every item contains a trailing line break
# which would lead to two line breaks between each item
$nestedPropertyString = $nestedPropertyString.Substring(2)
}
$currentProperty += $nestedPropertyString
Expand Down
14 changes: 7 additions & 7 deletions Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -3516,13 +3516,13 @@ This function removes all empty values from a dictionary object
.Functionality
Internal
#>
function Remove-EmptyValue
function Remove-M365DSCEmptyValue
{
[alias('Remove-EmptyValues')]
[Alias('Remove-M365DSCEmptyValues')]
[CmdletBinding()]
param
(
[alias('Splat', 'IDictionary')][Parameter(Mandatory)][System.Collections.IDictionary] $Hashtable,
[Alias('Splat', 'IDictionary')][Parameter(Mandatory)][System.Collections.IDictionary] $Hashtable,
[string[]] $ExcludeParameter,
[switch] $Recursive,
[int] $Rerun
Expand All @@ -3542,7 +3542,7 @@ function Remove-EmptyValue
}
else
{
Remove-EmptyValue -Hashtable $Hashtable[$Key] -Recursive:$Recursive
Remove-M365DSCEmptyValue -Hashtable $Hashtable[$Key] -Recursive:$Recursive
}
}
else
Expand All @@ -3566,7 +3566,7 @@ function Remove-EmptyValue
{
for ($i = 0; $i -lt $Rerun; $i++)
{
Remove-EmptyValue -Hashtable $Hashtable -Recursive:$Recursive
Remove-M365DSCEmptyValue -Hashtable $Hashtable -Recursive:$Recursive
}
}
}
Expand Down Expand Up @@ -3767,7 +3767,7 @@ function Update-M365DSCExportAuthenticationResults
$noEscape += 'AccessTokens'
}
}

return @{
Results = $Results
NoEscape = $noEscape
Expand Down Expand Up @@ -5253,7 +5253,7 @@ Export-ModuleMember -Function @(
'New-M365DSCCmdletDocumentation',
'New-M365DSCConnection',
'New-M365DSCMissingResourcesExample',
'Remove-EmptyValue',
'Remove-M365DSCEmptyValue',
'Remove-M365DSCAuthenticationParameter',
'Remove-NullEntriesFromHashtable',
'Set-EXOSafeAttachmentRule',
Expand Down
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ additional resources, please navigate to the official web site at
official YouTube channel
[Microsoft365DSC](https://www.youtube.com/channel/UCveScabVT6pxzqYgGRu17iw).

## Roadmap & Backlog

We are using Azure DevOps for project management. You can access our backlog and roadmap by clicking on the status badge below:

[![Board Status](https://dev.azure.com/Microsoft365DSC/c730cd2b-2b5f-4af2-8bce-2b7b3ee6f69b/e58164ef-f760-40e9-bd67-893cf4938bef/_apis/work/boardbadge/84871665-8a0f-46de-8a93-c214ea36b371?columnOptions=1)](https://dev.azure.com/Microsoft365DSC/Backlog/_workitems/)

## Branches

### master
Expand Down
22 changes: 11 additions & 11 deletions Tests/Unit/Microsoft365DSC/Microsoft365DSC.Utils.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Test6 = 6
}

Remove-EmptyValue -Splat $Splat
Remove-M365DSCEmptyValue -Splat $Splat
{ Test-FunctionHashtable @Splat } | Should -Not -Throw
}
It 'From OrderedDictionary' {
Expand All @@ -44,7 +44,7 @@
Test5 = 0
Test6 = 6
}
Remove-EmptyValue -Splat $SplatDictionary
Remove-M365DSCEmptyValue -Splat $SplatDictionary
{ Test-FunctionOrderedDictionary @SplatDictionary } | Should -Not -Throw
}
It 'From OrderedDictionary but with ExcludedProperty' {
Expand All @@ -56,7 +56,7 @@
Test5 = 0
Test6 = 6
}
Remove-EmptyValue -Splat $SplatDictionary -ExcludeParameter 'Test3'
Remove-M365DSCEmptyValue -Splat $SplatDictionary -ExcludeParameter 'Test3'
$SplatDictionary['Test3'] | Should -Be ''
}
It 'From OrderedDictionary Recursive' {
Expand All @@ -69,10 +69,10 @@
Test6 = 6
Test7 = @{}
}
Remove-EmptyValue -Splat $SplatDictionary
Remove-M365DSCEmptyValue -Splat $SplatDictionary
$SplatDictionary.Keys | Should -Contain 'Test7'

Remove-EmptyValue -Splat $SplatDictionary -Recursive
Remove-M365DSCEmptyValue -Splat $SplatDictionary -Recursive
$SplatDictionary.Keys | Should -Not -Contain 'Test7'
}
It 'From OrderedDictionary Recursive with ILIST check' {
Expand All @@ -91,11 +91,11 @@
}
$SplatDictionary.Test6.Add($DummyObject)

Remove-EmptyValue -Splat $SplatDictionary
Remove-M365DSCEmptyValue -Splat $SplatDictionary
$SplatDictionary.Keys | Should -Contain 'Test6'
$SplatDictionary.Keys | Should -Contain 'Test7'

Remove-EmptyValue -Splat $SplatDictionary -Recursive
Remove-M365DSCEmptyValue -Splat $SplatDictionary -Recursive
$SplatDictionary.Keys | Should -Not -Contain 'Test7'
}
It 'From OrderedDictionary Recursive with ILIST check for Empty Arrays' {
Expand All @@ -117,14 +117,14 @@
}
$SplatDictionary.Test6.Add($DummyObject)

Remove-EmptyValue -Splat $SplatDictionary
Remove-M365DSCEmptyValue -Splat $SplatDictionary
$SplatDictionary.Keys | Should -Contain 'Test6'
$SplatDictionary.Keys | Should -Contain 'Test7'
$SplatDictionary.Keys | Should -Not -Contain 'Test8'
$SplatDictionary.Keys | Should -Not -Contain 'Test9'
$SplatDictionary.Keys | Should -Contain 'Test10'

Remove-EmptyValue -Splat $SplatDictionary -Recursive
Remove-M365DSCEmptyValue -Splat $SplatDictionary -Recursive
$SplatDictionary.Keys | Should -Not -Contain 'Test7'
}
It 'Testing edge cases' {
Expand All @@ -151,7 +151,7 @@
Rotate6 = $null, ''
}

Remove-EmptyValue -Hashtable $Splat
Remove-M365DSCEmptyValue -Hashtable $Splat
$Splat.Keys | Should -Contain 'Rotate6'
$Splat.Keys | Should -Not -Contain 'Rotate5'
$Splat.Keys | Should -Contain 'Rotate4'
Expand All @@ -168,7 +168,7 @@
$Splat.Margins.Keys | Should -Contain TestBool2
$Splat.Margins.Keys | Should -Contain TestBoolArray

Remove-EmptyValue -Hashtable $Splat -Recursive
Remove-M365DSCEmptyValue -Hashtable $Splat -Recursive
$Splat.Margins.Keys | Should -Not -Contain MarginRight2
}
}

0 comments on commit 520caa5

Please sign in to comment.