使用Team市2017年1月1日(建46654)我想10下载文物
我用这来下载Windows上使用REST从Powershell的文物: https://confluence.jetbrains.com/display/TCD10/REST+API#RESTAPI-BuildArtifacts
但我仍然无法工作。举个例子,我想下载info.txt神器,我可以从下面的URL访问使用我的浏览器:
http://mytc/repository/download/MyBuildConfiguration/294859:id/output/logs/info.txt
基于: https://confluence.jetbrains.com/display/TCD10/REST+API#RESTAPI-BuildArtifacts
我做从PowerShell中的以下内容:
$TeamCityUser = 'tcuser'
$TeamCityPassword = 'tcpass'
$securePassword = ConvertTo-SecureString $TeamCityPassword -AsPlainText -Force
$creds = New-Object System.Management.Automation.PSCredential($TeamCityUser, $securePassword)
$response = Invoke-WebRequest http://mytc/httpAuth/app/rest/builds/294859:id/artifacts/output/logs/info.txt -Credential $creds
但我得到的错误:
Invoke-WebRequest : The remote server returned an error: (400) Bad Request.
基于以下建议,我现在已经尝试:
$response = Invoke-WebRequest http://mytc/httpAuth/app/rest/builds/id:294859/artifacts/output/logs/info.txt -Credential $creds
但仍获得:
Invoke-WebRequest : The remote server returned an error: (404) Not Found.
任何想法?
你见过[this](https://stackoverflow.com/questions/14242139/how-do-i-download-a-protected-file-using-powershell)吗? – grundic