Private/ArgumentCompleter/Get-OrbitAcSbTenantDialPlanNormalizationRuleIds.ps1

# CsTenantDialPlanNormalizationRuleIds
function Get-OrbitAcSbTenantDialPlanNormalizationRuleIds {
  param ( $commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters )
  $null = Assert-MicrosoftTeamsConnection
  if (-not $global:OrbitTenantDialPlan) { $global:OrbitTenantDialPlan = Get-CsTenantDialPlan | Sort-Object -Property Identity -WarningAction SilentlyContinue }
  $Values = $global:OrbitTenantDialPlan.Identity -replace 'Tag:', '' | ForEach-Object {
    $DPName = $_.Identity -replace 'Tag:', ''
    $_.NormalizationRules | ForEach-Object { "$DPName\$($_.Name)" }
  }
  $Values | Where-Object { $_ -like "*$WordToComplete*" } | ForEach-Object { $_ }
}
# [ArgumentCompleter({ Get-OrbitAcSbTenantDialPlanNormalizationRuleIds @args })]
Register-ArgumentCompleter -CommandName Get-TeamsVoiceNormalizationRule -ParameterName Identity -ScriptBlock { Get-OrbitAcSbTenantDialPlanNormalizationRuleIds @args }


<# Previous version
function Get-OrbitAcSbTenantDialPlanNormalizationRuleIds {
  param ( $commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters )
  $null = Assert-MicrosoftTeamsConnection
  $Values = (Get-CsTenantDialPlan | Sort-Object -Property Identity).Identity -replace 'Tag:', '' | ForEach-Object {
    $DPName = $_.Identity -replace 'Tag:', ''
    $_.NormalizationRules | ForEach-Object { "$DPName\$($_.Name)" }
  }
  $Values | Where-Object { $_ -like "*$WordToComplete*" } | ForEach-Object { $_ }
}
#>