问题描述
我有一个调用 Sharepoint Web 服务 SPDocumentDownloader.exe 的批处理脚本。 Web 服务从共享点库中提取文档并将该文档复制到文件共享。从命令行运行 SPDocumentDownloader.exe 时,它会成功运行。但是,当它使用下面的脚本从 Powershell 运行时,它会完成而不会出错,但不会从库中提取文档并将其复制到文件共享。你知道问题是什么以及如何解决这个问题吗?
下载CSRPDocument.bat:
SET PATH=%PATH%%systemRoot%\System32;%systemRoot%\system32\WindowsPowerShell\v1.0\;
set
whoami
set TMP=s:\apps\sharepoint\Temp
powershell -executionpolicy ByPass s:\apps\sharepoint\DownloadCSRPDocumentSP2010.ps1
下载CSRPDocumentSP2010.ps1:
# The document is downloaded to path defined in config file SPDocumentDownloader.exe.config
$Site = 'https://txportal.ire.ite.int/orgs/TP/TPC/CSRP'
$Library = 'CSRP Document Library'
$Document = '08TX-13646 Agreement Executed 10-15-08.pdf'
$GLOBAL:priority="normal"
$d = Get-Date
$Date = $d.ToShortDateString()
$Time = $d.ToShortTimeString()
PWD
whoami
#display Message to Screen
Write-Output "Extracting document $Document from library $Library on Sharepoint site $Site @ $date"
$ConfigPath = 'S:\apps\sharepoint\'
$ConfigPathAndFile = 'S:\apps\sharepoint\SPDocumentDownloader.exe'
$ConfigFile = 'DefaultConfig.txt'
$LogFile = 'CSRPMsg.log'
$MessageFile = 'CSRPMsgDefaults.txt'
# SPDocumentDownloader.exe https://txportal.ire.ite.int/orgs/TP/TPC/CSRP “CSRP Document Library” “08TX-13646 Agreement Executed 10-15-08.pdf”
start-process -Filepath $ConfigPathAndFile -ArgumentList "$Site $Library $Document" -WorkingDirectory $ConfigPath -NoNewWindow -Wait
"Finished with Processing" | Out-File -FilePath $ConfigPath$LogFile
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)