0
我在使用GFS檢索樹的TFS Rest API時遇到問題。使用TFS Git Rest api檢索樹時遇到問題
相關的代碼是
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Accept", 'application/zip')
$DownloadTreeCmd = "http://tfs.mycompany.com:8080/tfs/myCollection/_apis/git/repositories/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx/trees/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx?api-version=1.0&filename=TempDownload.zip&recursive=1"
$nresp = Invoke-RestMethod $DownloadTreeCmd -UseDefaultCredentials -Headers $headers
我結束了在$ nrest,我不能讀的東西。我試過把它寫入一個文件,但它不被識別爲一個zip文件。我可以看到我的數據似乎是二進制數據。
我該如何處理這些數據。