Skip to content

Instantly share code, notes, and snippets.

@milnak
Last active August 15, 2024 18:08
Show Gist options
  • Save milnak/7d104336b2020c4b868de9743bbef6c5 to your computer and use it in GitHub Desktop.
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
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