Jun 29 2019 12:57 AM
$UserName="user@domain"
$pwd ="StrongPassword"
$SiteUrl = "https://domaincorp.sharepoint.com/sites/testing"
$encpassword = convertto-securestring -String $pwd -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $encpassword
Connect-PnPOnline -Url $SiteUrl -Credentials $cred
echo "connected"
Add-PnPFile -Path '.\localFileName.docx' -Folder 'Documents'