In this blog, we are going to learn how to copy the attachments from a single list item to SharePoint library using PnP PowerShell. The following snippet helps, you to get the attachments from a list item and uploads to the shared Documents library in a current context site.SharePoint-2013-Hosting

After running the powershell command, it asks us to confirm the sourceurl and target url. If the file already exists in the targeturl, we have to add -OverwriteIfAlreadyExists $true to avoid the file already exists error.

Below is the example copies the two attachments from the single list item to the folder within a SharePoint library.