Dear Farazuddin Mohammed,
Good day! Thank you for posting to Microsoft Community. We are happy to help you.
We are sorry to hear that you’re having trouble with to make a Copy of a SharePoint List with All Content/Data. I deeply understand the inconvenience caused and apologize for it.
You can follow the below steps to duplicate your List into another Site using PowerShell.
The first thing we’ll do is to register App so that we can use PnP cmdlet on this device
Register-PnPAzureADApp -ApplicationName TestApp -Tenant m*************8.onmicrosoft.com -Store CurrentUser -Interactive
Then connect to the source site. (Please note that the ClientID is obtained while registering the app like in the Above screenshot)
Connect-PnPOnline -Url "https://m*************8..sharepoint.com/sites/AlphaTest" -Interactive -ClientId 62*************27e8
We actually have two lists we need to copy. Fellowship Members is the list we care about but, since it contains a lookup column, we need to grab the Middle Earth Locales lookup list as well.
Get-PnPSiteTemplate -Out ListsAL.xml -ListsToExtract "Alpha List" -Handlers Lists
We’ll use the Add-PnPDataRowToSiteTemplate cmdlet to populate our list instances with actual list item. Add-PnPDataRowsToSiteTemplate -Path ListsAL.xml -List "Alpha List" Now we connect to the target site. Connect-PnPOnline -Url "https://m8.sharepoint.com/sites/Beta" -Interactive -ClientId 6227e8 And we apply our template using the Invoke-PnPSiteTemplate cmdlet.
Invoke-PnPSiteTemplate -Path ListsAL.xml
We appreciate your understanding that sometimes the initial response may not resolve the problem immediately. However, we can work together to narrow down and resolve the situation. So, please let me know if you have any further questions or if there are any misunderstandings.
Once again, I apologize for the inconvenience this has caused. We appreciate your patience and understanding and thank you for your time and cooperation.
Sincerely,
Ralph Chawatama | Microsoft Community Moderator