使用PowerShell从SharePoint下载时,Invoke-WebRequest会生成损坏的文件

时间:2018-02-16 12:52:15

标签: powershell sharepoint

我正在尝试使用PowerShell脚本将文件从我们的SharePoint本地下载到我的计算机。当我登录SharePoint并运行以下命令时,我得到一个损坏的文件,大约是SharePoint上文件大小的一半。 InvokeWebRequest "https://our.sharepoint.com/Docs/file.pptx" -OutFile out.pptx

当我从命令中删除-OutFile out.pptx时,新的Chrome标签会打开到https://login.microsoftonline.com/common/cookiesdisabled

知道我做错了什么吗?

enter image description here

我还尝试了System.Net.WebClient及其DownloadFile,但即使我设置了凭据,我仍然会获得Unathorized 401。我想我错过了什么,但我不确定是什么。

0 个答案:

没有答案
相关问题