pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
990 stars 663 forks source link

Get-PnPFile error when downloading files using a foreach loop #2900

Open Lalit-Madan opened 4 years ago

Lalit-Madan commented 4 years ago

Reporting an Issue or Missing Feature

Exception thrown randomly when using the Get-PnPFile inside a foreach loop to download all the files of a document library Error - Unable to read data from the transport connection. The connection was closed.

Expected behavior

It should download the file from the relative url specified

Actual behavior

Please describe what you see instead. Please provide samples of HTML output or screenshots image

Steps to reproduce behavior

Please include complete code samples in-line or linked from gists

function($fileRelativeUrl) { Get-PnPFile -ServerRelativeUrl $fileRelativeUrl -AsFile -Force -ErrorAction Stop }

Which version of the PnP-PowerShell Cmdlets are you using?

What is the version of the Cmdlet module you are running?

(you can retrieve this by executing Get-Module -Name sharepointpnppowershell* -ListAvailable) All of the following are installed SharePointPnPPowerShellOnline 3.24.2008.1 SharePointPnPPowerShellOnline 3.24.2008.0 SharePointPnPPowerShellOnline 3.11.1907.0

How did you install the PnP-PowerShell Cmdlets?

ghost commented 4 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.