Script Download:
The script is available for download from https://gallery.technet.microsoft.com//How-to-automactically-1bc0ddd6. You can also use Microsoft Script Browser for Windows PowerShell ISE to download the sample with one button click from within your scripting environment.
This script can upload/download files or folders to/from library of SharePoint Online
Prerequisites This script requires SharePoint Server 2013 Client Components SDK. Please download and install the package from Microsoft Download Center. This script cannot work correctly without this package.
You can find more All-In-One Script Framework script samples at http://aka.ms/onescriptingallery