Is there a way to send output from PowerShell directly into a SharePoint ONLINE library?

Tony GA 31 Reputation points
2022-04-29T21:24:25.5+00:00

I have seen dozens of questions like this and every one of them is answered with how to UPLOAD a file to SharePoint Online from within PowerShell. That is NOT the same thing and is not the question that I am asking.

I am trying to develop a script that will generate a simple csv and store it in a SharePoint Online library. Eventually I want to move this to utilize Azure Automation and schedule this activity.
Thus the output file from the PowerShell script cannot be stored locally, it must be generated directly into SharePoint Online.

Can this be accomplished with PowerShell?

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,610 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,362 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 31,071 Reputation points Microsoft Vendor
    2022-05-02T03:18:22.733+00:00

    Hi @Tony GA ,
    Per my research, there is no such function to Generate files directly in SharePoint. I feel regretful to inform you that it turns out to be a by-design one.

    And I noticed that some end users have also proposed the same request, it is highly recommended that you can vote this ticket. Many features of our current products are designed and upgraded based on customers’ feedback. With requirements like this increase, the problem may well be released in the future. Thanks for your understanding.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



  2. Rich Matheisen 44,776 Reputation points
    2022-05-09T14:12:44.453+00:00

    Would one of the .Net WebClient classes method work? Something like this, maybe? webclient-uploadstring

    0 comments No comments