Fix SharePoint Online “The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator.” in PowerShell

Problem: When trying to get list items from a SharePoint Online list through PowerShell, got this error message:Exception calling “ExecuteQuery” with “0” argument(s): “The attempted operation is prohibited because it  exceeds the list view threshold enforced by the administrator.”At line:26 char:5+     $Ctx.ExecuteQuery()+     ~~~~~~~~~~~~~~~~~~~    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException    + FullyQualifiedErrorId…

Read more