Skip to content

Commit

Permalink
Merge pull request #1700 from NikCharlebois/Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NikCharlebois authored Jan 25, 2022
2 parents 20676b3 + aa53726 commit 76c81cd
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 24 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# 1.22.126.1

*TeamsTenantDialPlan
* Fixed an issue where the Export only extracted the first
normalization rule.
FIXES #1695
* DEPENDENCIES
* Updated all Microsoft.Graph * to 1.9.2;
* Updated Microsoft.Teams to version 3.1.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,14 +433,7 @@ function Export-TargetResource

if ($results.NormalizationRules.Count -gt 0)
{
if ($results.NormalizationRules.GetType().Name -eq "Hashtable")
{
$results.NormalizationRules = Get-M365DSCNormalizationRulesAsString $results.NormalizationRules
}
else
{
$results.NormalizationRules = Get-M365DSCNormalizationRulesAsString $results.NormalizationRules[0]
}
$results.NormalizationRules = Get-M365DSCNormalizationRulesAsString $results.NormalizationRules
}
$currentDSCBlock = " TeamsTenantDialPlan " + (New-Guid).ToString() + "`r`n"
$currentDSCBlock += " {`r`n"
Expand Down Expand Up @@ -591,31 +584,37 @@ function Get-M365DSCNormalizationRulesAsString
[OutputType([System.String])]
param(
[Parameter(Mandatory = $true)]
[System.Collections.Hashtable]
[System.Object[]]
$Params
)

if ($null -eq $params)
{
return $null
}
$currentProperty = "@(MSFT_TeamsVoiceNormalizationRule{`r`n"
foreach ($key in $params.Keys)
$currentProperty = "@("

foreach ($rule in $params)
{
if ($key -eq 'Priority')
{
$currentProperty += " " + $key + " = " + $params[$key] + "`r`n"
}
elseif ($key -eq "IsInternalExtension")
{
$currentProperty += " " + $key + " = `$" + $params[$key] + "`r`n"
}
else
$currentProperty += "MSFT_TeamsVoiceNormalizationRule{`r`n"
foreach ($key in $rule.Keys)
{
$currentProperty += " " + $key + " = '" + $params[$key] + "'`r`n"
if ($key -eq 'Priority')
{
$currentProperty += " " + $key + " = " + $rule[$key] + "`r`n"
}
elseif ($key -eq "IsInternalExtension")
{
$currentProperty += " " + $key + " = `$" + $rule[$key] + "`r`n"
}
else
{
$currentProperty += " " + $key + " = '" + $rule[$key] + "'`r`n"
}
}
$currentProperty += " }"
}
$currentProperty += " })"
$currentProperty += ")"
return $currentProperty
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/Microsoft365DSC/Dependencies/Manifest.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
@{
ModuleName = "Microsoft.Graph.Identity.DirectoryManagement"
RequiredVersion = "1.9."
RequiredVersion = "1.9.2"
},
@{
ModuleName = "Microsoft.Graph.Identity.Governance"
Expand Down
2 changes: 1 addition & 1 deletion Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function Get-TeamByName
$loopCounter = 0
do
{
$team = Get-Team -DisplayName $TeamName
$team = Get-Team -DisplayName $TeamName | Where-Object -FilterScript {$_.DisplayName -eq $TeamName}
if ($null -eq $team)
{
Start-Sleep 5
Expand Down

0 comments on commit 76c81cd

Please sign in to comment.