Postgresql Plpgsql Loop Through Array Powershell Script If Statement