Last active
August 15, 2024 18:08
-
-
Save milnak/7d104336b2020c4b868de9743bbef6c5 to your computer and use it in GitHub Desktop.
rclone folder: Copy music folder from my OneDrive to enScore music folder using rclone
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Param( | |
| [switch]$List, | |
| [switch]$Check, | |
| [switch]$Clone | |
| ) | |
| # Copy music folder from my OneDrive to enScore music folder using rclone | |
| $source = 'onedrive:"Documents/Band Charts/Pazific"' | |
| $dest = "$env:LocalAppData\Packages\54636JonathanVardouniotis.enScoreSheetMusicReader_3p6s0exh8v0we\LocalState\SheetMusic\Pazific" | |
| if ($List) { | |
| "`nSource...`n" | |
| Start-Process -Wait -NoNewWindow -FilePath 'rclone.exe' -ArgumentList @('ls', '--max-depth 2', $source) | |
| if (Test-Path -LiteralPath $dest -PathType Container) { | |
| "`nDestination...`n" | |
| # Select-Object will put output out of order. | |
| Get-ChildItem $dest # | Select-Object Length,Name | |
| } | |
| } | |
| if ($Check) { | |
| "`nChecking...`n" | |
| Start-Process -Wait -NoNewWindow -FilePath 'rclone.exe' -ArgumentList @('check', $source, $dest, '--progress', '--size-only') | |
| } | |
| if ($Clone) { | |
| "`nCopying...`n" | |
| Start-Process -Wait -NoNewWindow -FilePath 'rclone.exe' -ArgumentList @('copyto', $source, $dest, '--progress', '--transfers 1') | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment