Public/Test-InKibitzrHistory.ps1
function Test-InKibitzrHistory { [OutputType([bool])] param ( [Parameter(Mandatory)] [string]$ApiKey, [Parameter(Mandatory)] [string]$BaseName, [Parameter(Mandatory, Position = 0)] [string]$TableName, [Parameter(Mandatory)] [string]$Url, [DateTime]$DateTime, [string]$Title, [string]$Body, [Switch]$SkipAdd ) $Result = Test-AirTableRecord -ApiKey $ApiKey -BaseName $BaseName -TableName $TableName -FieldName Url -Value $Url switch ($Result) { $true { Write-Warning "Notification for url '$Url' already sent." } $false { if (-not $SkipAdd) { New-AirTableRecord -ApiKey $ApiKey -BaseName $BaseName -TableName $TableName -Fields @{Url = $Url; DateTime = $DateTime; Title = $Title; Body = $Body } } } } $Result } |