microsoft / Code-Search

Code Search Admin scripts (SQL and PS) for managing a Code Search on-prem instance
53 stars 65 forks source link

How do I search using powershell on premise TFS ? #38

Open rifaterdemsahin opened 6 years ago

rifaterdemsahin commented 6 years ago

I am running TFS 2017 on prem update 2

$tfsUrl = 'https://tfs:444/tfs' $projectId = 'd18ff858-xxxxxxxx' $teamId = '9907188a-xxxxxxxx' $tfsRepos = "$tfsUrl/Common/$projectId/_apis/search/codesearchresults?api-version=4.1-preview.1" $secureCredential = Get-Credential $allResults = (Invoke-RestMethod -Uri $tfsRepos -Method Post -Credential $secureCredential).value $allResults= $allResults | Select -first 20

I am getting this error

Invoke-RestMethod : Page not found. - Microsoft Team Foundation Server

Reference ( Could not find TFS Api reference only for the VSTS one is there ) https://docs.microsoft.com/en-us/rest/api/vsts/search/code%20search%20results/fetch%20code%20search%20results

soodputter commented 5 years ago

Hi, i have same problem. Did you find any solution?

Thanks