Skip to content

Commit

Permalink
Fix New-M365DSCDeltaReport: Error: Cannot bind argument to parameter …
Browse files Browse the repository at this point in the history
…'DifferenceObject' because it is null microsoft#3478
  • Loading branch information
sandrola committed Oct 27, 2023
1 parent 1565a24 commit 7823132
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function Get-TargetResource

if (-not [String]::IsNullOrEmpty($source.AdditionalProperties.tenantId))
{
$formattedSource.Add('ExternalTenantId', $source.AdditionalProperties.tenantId)
$formattedSource.Add('tenantId', $source.AdditionalProperties.tenantId)
}

if (-not [String]::IsNullOrEmpty($source.AdditionalProperties.cloudInstance))
Expand Down Expand Up @@ -313,7 +313,7 @@ function Set-TargetResource
$CreateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $CreateParameters.$key
}
}
$TenantId = $CreateParameters.IdentitySources.ExternalTenantId
$TenantId = $CreateParameters.IdentitySources.tenantId
$url = $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl + "beta/tenantRelationships/microsoft.graph.findTenantInformationByTenantId(tenantId='$tenantid')"
$DomainName = (Invoke-MgGraphRequest -Method 'GET' -Uri $url).defaultDomainName
$newConnectedOrganization = New-MgBetaEntitlementManagementConnectedOrganization -Description $CreateParameters.Description -DisplayName $CreateParameters.DisplayName -State $CreateParameters.State -DomainName $DomainName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class MSFT_AADEntitlementManagementConnectedOrganizationIdentitySource
{
[Write, Description("Type of the identity source."), ValueMap{"#microsoft.graph.azureActiveDirectoryTenant","#microsoft.graph.crossCloudAzureActiveDirectoryTenant","#microsoft.graph.domainIdentitySource","#microsoft.graph.externalDomainFederation"}, Values{"#microsoft.graph.azureActiveDirectoryTenant","#microsoft.graph.crossCloudAzureActiveDirectoryTenant","#microsoft.graph.domainIdentitySource","#microsoft.graph.externalDomainFederation"}] String odataType;
[Write, Description("The name of the Azure Active Directory tenant.")] String DisplayName;
[Write, Description("The ID of the Azure Active Directory tenant.")] String ExternalTenantId;
[Write, Description("The ID of the Azure Active Directory tenant.")] String tenantId;
[Write, Description("The ID of the cloud where the tenant is located, one of microsoftonline.com, microsoftonline.us or partner.microsoftonline.cn.")] String CloudInstance;
[Write, Description("The domain name.")] String DomainName;
[Write, Description("The issuerURI of the incoming federation.")] String IssuerUri;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Id = 'ConnectedOrganization_Id'
IdentitySources = @(
(New-CimInstance -ClassName MSFT_AADEntitlementManagementConnectedOrganizationIdentitySource -Property @{
ExternalTenantId = 'IdentitySource_TenantId'
tenantId = 'IdentitySource_TenantId'
odataType = '#microsoft.graph.azureActiveDirectoryTenant'
displayName = 'IdentitySource_DisplayName'
} -ClientOnly)
Expand Down Expand Up @@ -130,7 +130,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Id = 'ConnectedOrganization_Id'
IdentitySources = @(
(New-CimInstance -ClassName MSFT_AADEntitlementManagementConnectedOrganizationIdentitySource -Property @{
ExternalTenantId = 'IdentitySource_TenantId'
tenantId = 'IdentitySource_TenantId'
odataType = '#microsoft.graph.azureActiveDirectoryTenant'
displayName = 'IdentitySource_DisplayName'
} -ClientOnly)
Expand Down Expand Up @@ -197,7 +197,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Id = '12345678-1234-1234-1234-123456789012'
IdentitySources = @(
(New-CimInstance -ClassName MSFT_AADEntitlementManagementConnectedOrganizationIdentitySource -Property @{
ExternalTenantId = 'IdentitySource_TenantId'
tenantId = 'IdentitySource_TenantId'
odataType = '#microsoft.graph.azureActiveDirectoryTenant'
displayName = 'IdentitySource_DisplayName'
} -ClientOnly)
Expand Down Expand Up @@ -254,7 +254,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Id = '12345678-1234-1234-1234-123456789012'
IdentitySources = @(
(New-CimInstance -ClassName MSFT_AADEntitlementManagementConnectedOrganizationIdentitySource -Property @{
ExternalTenantId = 'IdentitySource_TenantId'
tenantId = 'IdentitySource_TenantId'
odataType = '#microsoft.graph.azureActiveDirectoryTenant'
displayName = 'IdentitySource_DisplayName'
} -ClientOnly)
Expand Down

0 comments on commit 7823132

Please sign in to comment.