csom – powershell query row limits for SharePoint online

I am not a super scripter, but I have a requirement run a search query over a site with multiple libraries. The query is for all documents where a specific string (someone’s name) appears.

I have 2 different scripts that I’ve tested and they work well, but I saw some stuff online about row limitations at 500 items.

Questions:

  • Is this true, is there any clear documentation about this anywhere?
  • If it is true, is there a way around it?
  • When we say 500 row limitation, do we mean it can only retrieve 500 items, or it only looks through 500 items? Must be the former, right?

Thanks for your help. For reference:
Script 1 – slight variation from this: CSOM

Script 2 – same as this script, but checking body not title PnP