Hi,
I am trying to build / modify a script that will place a file into a path such ashttps://Domain-my.sharepoint.com/personal/User_Domain_com/Documents/Home-Drive/AnotherFolder
and even deeper down the tree. Nothing I havwe been trying seems to work. Can someone please recommend how to select the next level subfolders
$Context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL) $Context.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($credentials.UserName, $credentials.Password) $libraryName = "Documents"$Docs = $ctx.Web.Lists.GetByTitle("$libraryName")$ctx.Load($Docs)$ctx.Load($Docs.RootFolder) $ctx.ExecuteQuery() $ctx.Load($Docs.RootFolder.Folders.GetByUrl("Documents/Home-drive")) $ctx.ExecuteQuery() But doing the same thing as above and trying to get to the next level folder returns below image$ctx.Load($Docs.RootFolder.Folders.GetByUrl("Documents/Home-drive/AnotherFolder")) $ctx.ExecuteQuery()
Wanted to add that the reason I am looking into this approach as apposed to PNP is because the files that I need to upload are larger then 250MB