Private/ArgumentCompleter/Get-OrbitAcSbNagerAPICountryCode.ps1
# PublicHolidayCountry - Subset of ISO3166Country (supported by Nager.API) function Get-OrbitAcSbNagerAPICountryCode { param ( $commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters ) $null = Assert-MicrosoftTeamsConnection $Values = (Get-PublicHolidayCountry | Sort-Object CountryCode).CountryCode $Values | Where-Object { $_ -like "*$WordToComplete*" } | ForEach-Object { $_ } } # [ArgumentCompleter({ Get-OrbitAcSbNagerAPICountryCode @args })] Register-ArgumentCompleter -CommandName New-TeamsHolidaySchedule -ParameterName CountryCode -ScriptBlock { Get-OrbitAcSbNagerAPICountryCode @args } Register-ArgumentCompleter -CommandName Get-PublicHolidayList -ParameterName CountryCode -ScriptBlock { Get-OrbitAcSbNagerAPICountryCode @args } |