I want to add my document library as a web part to my collection site.
how is that possible using PowerShell, please ?
Yes, it's possible to add a web part to a page using PnP PowerShel
Example
Add-SPOWebPartToWebPartPage -ServerRelativePageUrl "/Pages/PnPPage.aspx" -Path "D:\PnP\NewWebPart.dwp" -ZoneId "WebPartZone2" -ZoneIndex 0
Note: you can get the
.dwpfile by exporting the web part manually, but the document library doesn't have the export option, so try to export it as mentioned at Unable to find the export web part option
Check the details steps,
If you are looking for adding a web part to web part gallery, check Deploy pre-configured web parts to web part gallery