microsoft / microsoft/Code-Search

How do I search using powershell on premise TFS ?

Open
#38 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
57
Forks
68
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the TFS 2017 Update 2 context, the PowerShell Invoke-RestMethod example, and the linked code-search-results reference. Determine whether the documented endpoint applies to on-premise TFS; done means providing an accurate on-premise usage path or documenting that it is unsupported.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
devops, search
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.