我正在尝试使用BITS将文件提交到OneDrive。我在这里找到了关于此的文章:https : //msdn.microsoft.com/en-us/library/dn858877.aspx ; 但是我希望PowerShell的本机Start-BitsTransfer
方法可以节省一些精力。但是,该文章暗示OneDrive支持BITS上传。所以事情是有希望的。
$source = '\\myFileServer\Backups\SqlServerDbBackup.bak' #3.2GB file
$destination = 'https://myCompany.sharepoint.com/personal/my_account/Documents/SqlServerDbBackup.bak'
$cred = get-credential #here I enter the same credentials I use to access the site
Start-BitsTransfer -Source $source -Destination $destination -TransferType Upload -Credential $cred
当我运行上面的代码时,进度条会短暂弹出,然后出现错误。完整的输出(包括凭据提示)如下:
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Start-BitsTransfer : HTTP status 501: The server does not support the functionality required to fulfill the request.
At line:8 char:1
+ Start-BitsTransfer -Source $source -Destination $destination -TransferType Uploa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-BitsTransfer], Exception
+ FullyQualifiedErrorId : StartBitsTransferCOMException,Microsoft.BackgroundIntelligentTransfer.Management.NewBitsTransferCommand
有没有人尝试过此操作/是否有可能使用进行上传到OneDrive的任何想法start-bitstransfer
?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句