Skip to content

Commit

Permalink
Merge branch 'Dev' into ref/migrate-laps-setting-catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
FabienTschanz committed Jun 11, 2024
2 parents 06918f3 + 3b9e4f5 commit 24661e9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 15 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

* IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy
* Migrate to new settings catalog cmdlets
* SPOTenantSettings
* Connect to Graph before Sharepoint Online
FIXES [#4746](https://github.com/microsoft/Microsoft365DSC/issues/4746)
* M365DSCDRGUtil
* Fixes an issue with the settings catalog property generation
* M365DSCUtil
Expand All @@ -18,10 +21,11 @@
* IntuneAppConfigurationDevicePolicy
* Add assignment group display name and fix compilation
FIXES [#4724](https://github.com/microsoft/Microsoft365DSC/issues/4724)
* Add conversion from `payloadJson` to actual JSON.
* M365DSCResourceGenerator
* Add support for generating Intune settings catalog policies
* Add support for generating Intune settings catalog policies.
* M365DSCDRGUtil
* Add multiple commands for Intune policies that use the settings catalog
* Add multiple commands for Intune policies that use the settings catalog.
* Improve comparison of Intune assignments in `Compare-M365DSCIntunePolicyAssignment`
* DEPENDENCIES
* Updated MSCloudLoginAssistant to version 1.1.17.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,17 @@ function Get-TargetResource
}
}

$payloadJson = $null
if (-not [System.String]::IsNullOrEmpty($getValue.AdditionalProperties.payloadJson))
{
$payloadJson = [System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String($getValue.AdditionalProperties.payloadJson))
}

$results = @{
#region resource generator code
ConnectedAppsEnabled = $getValue.AdditionalProperties.connectedAppsEnabled
PackageId = $getValue.AdditionalProperties.packageId
PayloadJson = $getValue.AdditionalProperties.payloadJson
PayloadJson = $payloadJson
PermissionActions = $complexPermissionActions
ProfileApplicability = $enumProfileApplicability
EncodedSettingXml = $getValue.AdditionalProperties.encodedSettingXml
Expand Down Expand Up @@ -362,6 +368,11 @@ function Set-TargetResource
$platform = 'ios'
}

if (-not [System.String]::IsNullOrEmpty($BoundParameters.PayloadJson))
{
$BoundParameters.PayloadJson = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($BoundParameters.PayloadJson))
}

$mobileApps = Get-MgBetaDeviceAppManagementMobileApp -All
$targetedApps = @()
foreach ($targetedApp in $TargetedMobileApps)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ function Get-TargetResource
)

Write-Verbose -Message 'Getting configuration for SPO Tenant'
$ConnectionMode = New-M365DSCConnection -Workload 'PNP' -InboundParameters $PSBoundParameters
$ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' -InboundParameters $PSBoundParameters
$ConnectionMode = New-M365DSCConnection -Workload 'PNP' -InboundParameters $PSBoundParameters

#Ensure the proper dependencies are installed in the current environment.
Confirm-M365DSCDependencies
Expand Down Expand Up @@ -393,11 +393,11 @@ function Set-TargetResource
Add-M365DSCTelemetryEvent -Data $data
#endregion

$ConnectionMode = New-M365DSCConnection -Workload 'PNP' -InboundParameters $PSBoundParameters
if (-not [string]::IsNullOrEmpty($TenantDefaultTimezone))
{
$ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' -InboundParameters $PSBoundParameters
}
$ConnectionMode = New-M365DSCConnection -Workload 'PNP' -InboundParameters $PSBoundParameters

$CurrentParameters = $PSBoundParameters
$CurrentParameters.Remove('Credential') | Out-Null
Expand Down Expand Up @@ -672,10 +672,10 @@ function Export-TargetResource

try
{
$ConnectionMode = New-M365DSCConnection -Workload 'PNP' `
-InboundParameters $PSBoundParameters
$ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' `
-InboundParameters $PSBoundParameters
$ConnectionMode = New-M365DSCConnection -Workload 'PNP' `
-InboundParameters $PSBoundParameters

#Ensure the proper dependencies are installed in the current environment.
Confirm-M365DSCDependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
displayName = "FakeStringValue"
id = "FakeStringValue"
PackageId = "FakeStringValue"
PayloadJson = "FakeStringValue"
PayloadJson = "{`"test`":`"value`"}"
permissionActions = [CimInstance[]]@(
(New-CimInstance -ClassName MSFT_MicrosoftGraphandroidPermissionAction -Property @{
permission = "FakeStringValue"
Expand Down Expand Up @@ -119,7 +119,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
displayName = "FakeStringValue"
id = "FakeStringValue"
PackageId = "FakeStringValue"
PayloadJson = "FakeStringValue"
PayloadJson = "{`"test`":`"value`"}"
permissionActions = [CimInstance[]]@(
(New-CimInstance -ClassName MSFT_MicrosoftGraphandroidPermissionAction -Property @{
permission = "FakeStringValue"
Expand Down Expand Up @@ -148,7 +148,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
AdditionalProperties = @{
appSupportsOemConfig = $True
'@odata.type' = "#microsoft.graph.androidManagedStoreAppConfiguration"
payloadJson = "FakeStringValue"
payloadJson = "eyJ0ZXN0IjoidmFsdWUifQ=="
profileApplicability = "default"
permissionActions = @(
@{
Expand Down Expand Up @@ -192,7 +192,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
displayName = "FakeStringValue"
id = "FakeStringValue"
PackageId = "FakeStringValue"
PayloadJson = "FakeStringValue"
PayloadJson = "{`"test`":`"value`"}"
permissionActions = [CimInstance[]]@(
(New-CimInstance -ClassName MSFT_MicrosoftGraphandroidPermissionAction -Property @{
permission = "FakeStringValue"
Expand Down Expand Up @@ -221,7 +221,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
AdditionalProperties = @{
appSupportsOemConfig = $True
'@odata.type' = "#microsoft.graph.androidManagedStoreAppConfiguration"
payloadJson = "FakeStringValue"
payloadJson = "eyJ0ZXN0IjoidmFsdWUifQ=="
profileApplicability = "default"
permissionActions = @(
@{
Expand Down Expand Up @@ -258,7 +258,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
displayName = "FakeStringValue"
id = "FakeStringValue"
PackageId = "FakeStringValue"
PayloadJson = "FakeStringValue"
PayloadJson = "{`"test`":`"value`"}"
permissionActions = [CimInstance[]]@(
(New-CimInstance -ClassName MSFT_MicrosoftGraphandroidPermissionAction -Property @{
permission = "FakeStringValue"
Expand Down Expand Up @@ -293,7 +293,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
action = "prompt"
}
)
payloadJson = "FakeStringValue"
payloadJson = "eyJ0ZXN0IjoidmFsdWUifQ=="
}
createdDateTime = "2023-01-01T00:00:00.0000000+01:00"
description = "FakeStringValue"
Expand Down Expand Up @@ -334,7 +334,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
AdditionalProperties = @{
appSupportsOemConfig = $True
'@odata.type' = "#microsoft.graph.androidManagedStoreAppConfiguration"
payloadJson = "FakeStringValue"
payloadJson = "{`"test`":`"value`"}"
profileApplicability = "default"
permissionActions = @(
@{
Expand Down

0 comments on commit 24661e9

Please sign in to comment.