Hi @Razzi29 ,
Welcome to Q&A forum!
I did a lot of research, but unfortunately, I couldn't find a PowerShell script that can be used to get the SharePoint online sitemap.
There are two workarounds for your reference.
For SharePoint online, it uses a modern experience. Navigate to the "Site Contents" page, where you can see a list of all the lists, libraries, and pages. While this is not a formal sitemap, it gives an overview of the site's structure.
Or you can use Content and structure to see all the subsites, lists and libraries in the site collection:
I know these workarounds are a bit unsatisfactory, so, based on the current situation, third-party tools seem to be a better choice.
Thank you for raising this requirement, so that Microsoft can better improve the product to provide users with a better experience. So we’d suggest you go to feedback on this issue, this is the best platform to let us hear from you and make our products and services better for you and others. A lot of features have been developed and suggested by customers via feedback.
Good day!
If the answer is helpful, please click "Accept as Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
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.