# Way to send output csv file from a script directly into SharePoint Online document library with overwrite if exists

**URL:** <https://forums.powershell.org/t/way-to-send-output-csv-file-from-a-script-directly-into-sharepoint-online-document-library-with-overwrite-if-exists/22528>\
**Category:** PowerShell Help\
**Created:** [June 28, 2023, 11:16am UTC](https://forums.powershell.org/t/way-to-send-output-csv-file-from-a-script-directly-into-sharepoint-online-document-library-with-overwrite-if-exists/22528 "2023-06-28T11:16:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![steveCFE](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@steveCFE](https://forums.powershell.org/u/steveCFE)\
**Post date:** [June 28, 2023, 11:16am UTC](https://forums.powershell.org/t/way-to-send-output-csv-file-from-a-script-directly-into-sharepoint-online-document-library-with-overwrite-if-exists/22528/1 "2023-06-28T11:16:30Z")

</div>

Hi,  
I usually export my csv output to a local file via export-csv , but I now have the requirement to output said csv file directly into a SharePoint Online document library, and overwrite the existing file. This will be run on a schedule.  
I know about the Add-PnPFile cmdlet but that still requires me to first output to a local file, and then copy it to SPO. Since I want to run this in an Azure automation job, I can’t do this.  
Anybody faced similar challenge and found a workable solution?  
Thanks 🙂

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [July 1, 2023, 6:24am UTC](https://forums.powershell.org/t/way-to-send-output-csv-file-from-a-script-directly-into-sharepoint-online-document-library-with-overwrite-if-exists/22528/2 "2023-07-01T06:24:33Z")

</div>

Welcome!

I haven’t but take a look at the Graph API.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:14pm UTC](https://forums.powershell.org/t/way-to-send-output-csv-file-from-a-script-directly-into-sharepoint-online-document-library-with-overwrite-if-exists/22528/3 "2024-05-16T20:14:51Z")

</div>


