PnP-PowerShell
PnP-PowerShell copied to clipboard
Get-PnPFile doesn't overwrite file
Reporting an Issue or Missing Feature
Missing Feature
Expected behavior
When a file is downloaded with the same name to a local drive it should prompt to overwrite or Force parameter should be added to overwrite the file without prompt
Actual behavior
It doesn't overwrite file, infact it doesn't download it at all if there is already a file with the same name in a local directory
Steps to reproduce behavior
Get-PnPFile -AsFile -Url /sites/testsite/document/sample.csv -Path "C:\test -FileName "test.csv"
Which version of the PnP-PowerShell Cmdlets are you using?
- [ ] PnP PowerShell for SharePoint 2013
- [ ] PnP PowerShell for SharePoint 2016
- [x] PnP PowerShell for SharePoint Online
What is the version of the Cmdlet module you are running?
2.18.17
How did you install the PnP-PowerShell Cmdlets?
- [x] MSI Installed downloaded from GitHub
- [ ] Installed through the PowerShell Gallery with Install-Module
- [ ] Other means
Thank you for bringing this up. Indeed, if the file exists it does not overwrite the existing file. I will add a -Force parameter to the cmdlet which will overwrite the file if it exists.