Hello I am trying to upload a file to my my Sharepoint Site (root directory) via PowerShell. I can connect to the url but having issues with when trying to upload the file i have installed Install-Module SharePointPnPPowerShellOnline
when i run the command i get this error
Add-PnPFile : The remote server returned an error: (403) Forbidden. At line:1 char:1 + Add-PnPFile -Path D:\delme\test.xlsx -Folder / + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : WriteError: (:) [Add-PnPFile], WebException + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Files.AddFile
Connect-PnPOnline –Url https://ABC123.sharepoint.com/sites/XXX/teamsites/os/Directory%20and%20Operating%20Systems/Forms/AllItems.aspx?viewpath=%2Fsites%2Fisd%2Fteamsites%2Fos%2FDirectory%20and%20Operating%20Systems%2FForms%2FAllItems.aspx
Add-PnPFile -Path D:\delme\test.xlsx -Folder /
I know I am close.