Hi @Shri-6058 ,
It is generally not recommended to export all the items and documents of the entire site collection for there may be many items/files in many lists and libraries.
As you have already known how to get item/document in a list/library, I found some posts for you, you could try to write your script:
Get All Web Applications in SharePoint using powershell
Get All Site Collections in a Web Applications using PowerShell
Get All List and Libraries Inventory of a SharePoint Site Collection using PowerShell
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.