UncommonSense.P2000.psm1
$Public = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue ) $Private = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue ) Foreach ($import in @($Private + $Public)) { Try { . $import.fullname } Catch { Write-Error -Message "Failed to import function $($import.fullname): $_" } } Register-ArgumentCompleter ` -CommandName 'Get-P2000Entry' ` -ParameterName 'Region' ` -ScriptBlock { param ( $commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter ) Get-P2000Region | Where-Object ID -like "$wordToComplete*" | Sort-Object -Property ID | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_.ID, $_.ID, 'ParameterValue', $_.ID) } } |