With File Server Migration to SharePoint Online, we can retrieve in SPO a large number of document libraries (to reduce issues with existing SPO limitations).
That is something acceptable from SPO point of view, but from user side, it could be quickly disturbing to find all those document libraries into the left menu without a clean order (in my case, it was more than 350 document libraries loaded).
One solution could be to simply apply an alphabetical order into this menu which is easy to explain to end users. With SharePoint web interface, that is really boring to do this ordering and PowerShell with PnP is perfect for.
You can find the script I developed that requirement, you can adapt with your specific requirement as you want.