Private/ArgumentCompleter/Get-OrbitAcSbSupportedTimeZone.ps1
# CsAutoAttendantSupportedTimeZone & OrbitSupportedTimeZone - AutoAttendant TimeZone Id function Get-OrbitAcSbSupportedTimeZone { param ( $commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters ) $null = Assert-MicrosoftTeamsConnection if (-not $global:CsAutoAttendantSupportedTimeZone) { $global:CsAutoAttendantSupportedTimeZone = Get-CsAutoAttendantSupportedTimeZone -ErrorAction SilentlyContinue } $Values = ($global:CsAutoAttendantSupportedTimeZone | Select-Object DisplayName).DisplayName | ForEach-Object { $_.Substring($_.IndexOf('(') + 1, $_.IndexOf(')') - 1) } | Get-Unique $Values | Where-Object { $_ -like "*$WordToComplete*" } | ForEach-Object { $_ } } # [ArgumentCompleter({ Get-OrbitAcSbSupportedTimeZone @args })] Register-ArgumentCompleter -CommandName New-TeamsAutoAttendant -ParameterName TimeZone -ScriptBlock { Get-OrbitAcSbSupportedTimeZone @args } Register-ArgumentCompleter -CommandName Update-TeamsAutoAttendant -ParameterName TimeZone -ScriptBlock { Get-OrbitAcSbSupportedTimeZone @args } |