Forum Discussion
Uday Kiran Reddy
Dec 12, 2017Copper Contributor
How to uploads files to OneDrive for Business using Powershell
I tried the sample powershell code in below link, getting error as path not found.
https://community.spiceworks.com/topic/2001221-powershell-script-to-upload-file-to-onedrive-business
Sam...
Manidurai Mohanamariappan
Dec 16, 2017Iron Contributor
Yes, this script only support upto 250 mb size for single file so if you want to upload more than 250mb file size of single file, you can refer the below link.
https://gist.github.com/asadrefai/ecfb32db81acaa80282d
Uday Kiran Reddy
Dec 16, 2017Copper Contributor
UploadFileInSlice ($ctx, $libraryName, $fileName, $fileChunkSizeInMB)
What is the $ctx we need to pass?
- Manidurai MohanamariappanDec 16, 2017Iron Contributor
Yes you need to pass the $ctx, $ctx is Client context
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$Creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($User,$Password)
$ctx.Credentials = $Creds