使用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