How to upload large file to OneDrive by Rest API via Powershell

This sample demonstrates how to upload large file to OneDrive by Rest API via Powershell.

Powershell.zip
 
 
 
 
 
4.7 Star
(3)
1,153 times
Add to favorites
Office
9/29/2016
E-mail Twitter del.icio.us Digg Facebook
  • Code source of ReadPartialFile.dll
    1 Posts | Last post December 11, 2018
    • Is this possible to have access to the source code of the dependency "ReadPartialFile.dll"?
  • Script Questions
    1 Posts | Last post August 24, 2017
    • This is a very helpful script.  But I just can't seem to get it to work.  I followed all the linked instructions for setting up and authorizing the app, but it always seems to hang on the authentication even though it authenticates in the browser.  Are there any requirements for the local website?  Or do you have any other directions that might help.  Thanks
  • Got it working but there were typos in the scripts
    2 Posts | Last post September 29, 2016
    • Have to do a search/replace of $SecrectKey with $SecretKey.
      
      Also, for a better example of the syntax the input variables expect:
      
      $ClientId = "5a6c348d-0e8b-1234-abcd-41b41fbec351" # your application clientid
      $SecretKey = "efqriF7siRDzaqq4hwj0yno" # the secret key for your application
      $RedirectURI = "https://dev.iishost.local" # the re-direct url of your local IIS website application (https is required, use a hosts file entry alias as localhost may not work)
      
      Further the link for the first part of the tutorial on setting up the API is broken.  The info is here:
      
      https://gallery.technet.microsoft.com/How-to-use-OneDrive-Rest-5b31cf78
      $LocalFilePath = "C:\Users\Me\Videos\MyShow.mp4" #The file path you prepared to upload
      $OneDriveTargetPath = "Videos/MyShow.mp4" #The target path in your onedrive
      
    • Thank you for your advice. We have already changed source code according to your great recommendation.
  • Other typo:
    1 Posts | Last post September 23, 2016
    • Also do a search/replace of $FilePath with $LocalFilePath.