I'm using the below script to copy the files from source library to destination library. Script run successfully but after certain period i am getting the below error.
I've close to 20000 items in source library to copy. Can one help on how to resolve this issue?
Error: Copy-PnPFile : The underlying connection was closed: An unexpected error occurred on a receive/send.
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; $SiteURL = "your site collection URL" $SourceFolderURL = "/sites/site collection name/document library name" $TargetFolderURL = "/sites/site collection name/document library name" #Connect to PnP Online Connect-PnPOnline -Url $SiteURL -UseWebLogin #Copy All Files and Folders between source and target folders Copy-PnPFile -SourceUrl $SourceFolderURL -TargetUrl $TargetFolderURL -SkipSourceFolderName -Force -OverwriteIfAlreadyExists