Public/Find-AirTableRecord.ps1
function Find-AirTableRecord { param ( [Parameter(Mandatory)] [string]$ApiKey, [Parameter(Mandatory)] [string]$BaseName, [Parameter(Mandatory, Position = 0)] [string]$TableName, [Parameter()] [ValidateNotNull()] [string[]]$Fields = @(), [Parameter()] [string]$Filter, [ValidateRange(1, [int]::MaxValue)] [int]$MaxRecords ) $PathElements = @( if ($Fields) { "fields=$($Fields -join ',')" } if ($Filter) { "filterByFormula=$Filter" } if ($MaxRecords) { "maxRecords=$MaxRecords" } ) Invoke-AirTableApi ` -ApiKey $ApiKey ` -BaseName $BaseName ` -TableName $TableName ` -Method Get ` -QueryString ($PathElements -join '&') | Select-Object -ExpandProperty Records | ConvertFrom-AirTableRecord -TableName $TableName } |