Home > Back-end >  Move file to Teams SharePoint directory using Powershell
Move file to Teams SharePoint directory using Powershell

Time:09-25

I'm trying to move a file to a Teams Channel\SharePoint directory using powershell. It appears to me that I only need three lines of code for proof of concept. I'm using the -UseWebLogin to get my login information

$Output = Get-ChildItem C:\Temp\ToSharepoint\Test.txt

Connect-PnPOnline -Url "https://My365.sharepoint.com/" –UseWebLogin

Add-pnpfile -path $Output -Folder enter image description here

CodePudding user response:

Here's the interface I'm working with and what I'm using. The only way I could get the picture in was to submit this as an answer, sorry about that.

$Output = Get-ChildItem C:\Temp\ToSharepoint\Test.txt

Connect-PnPOnline -Url "https://My365.sharepoint.com/sites/UnitedWeStand" –UseWebLogin

Add-pnpfile -path $Output -Folder "Documents/IT Communications"

Thanks again!

My Interface

  • Related