Send file to Teamschannel with Powershell

Alex_Ma 1 Reputation point
2021-03-31T14:13:49.927+00:00

Hello people.

Is there a way to send a files from PowerShell to a Teamchannel?

The following conditions have to be given:

  • Sending it via PowerShell Script
  • The file that arrives at the Teamschannel always has to have the same name (I will update the content of the file and send it regularly to the Teamschannel) -> overwriting existing file (this excludes a possible solution via mail)
    • The file always has to get saved at the same position in Sharepoint (this also excludes a possible solution via mail aswell)

(What I am actually trying to do:
I am creating an csv export on a server. This Export is needed for a PowerBI report which is why the name and saving path has to stay the same the entire time AND
has to be at a path that PowerBI has access to. This would be Sharepoint in my case since files shared in Teams are getting saved there.)

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,042 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,358 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 29,491 Reputation points Microsoft Vendor
    2021-04-01T05:54:40.68+00:00

    Hi @Alex_Ma ,

    As your issue is related to Teams, please add the Teams tag for better support.
    Hope this link could be helpful.
    https://childebrandt42.wordpress.com/2020/07/14/using-powershell-to-automate-file-adds-to-teams-and-sharepoint-online/
    Tip: This answer contains the content of a third-party website. Microsoft makes no representations about the content of these websites. We provide this content only for your convenience.

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    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.