Link

Get-TfsInstallationPath

Gets the installation path of a given Team Foundation Server component.


Table of Contents

  1. Syntax
  2. Description
  3. Examples
  4. Parameters
  5. Outputs
  6. Related Links

Syntax

Use computer name

Get-TfsInstallationPath
    [-Component <TfsComponent>]
    [-ComputerName <string>]
    [-Credential <PSCredential>]
    [-Version <int>]

Use session

Get-TfsInstallationPath
    -Session <PSSession>
    [-Component <TfsComponent>]
    [-Credential <PSCredential>]
    [-Version <int>]

[Go to top]

Description

Many times a Team Foundation Server admin needs to retrieve the location where TFS is actually installed. That can be useful, for instance, to locate tools like TfsSecurity or TfsServiceControl. That information is recorded at setup time, in a well-known location in the Windows Registry of the server where TFS is installed.

[Go to top]

Examples

Example 1

Gets the root folder (the BaseInstallationPath) of TFS in the local server where the cmdlet is being run

PS> Get-TfsInstallationPath -Version 2017

Example 2

Gets the location where the SharePoint Extensions have been installed in the remote server SPTFSSRV, prompting for admin credentials to be used for establishing a PS Remoting session to the server

PS> Get-TfsInstallationPath -Computer SPTFSSRV -Version 2015 -Component SharepointExtensions -Credentials (Get-Credentials)

Parameters

-Component

Indicates the TFS component whose installation path is being searched for. For the main TFS installation directory, use BaseInstallation. When omitted, defaults to BaseInstallation. Possible values: BaseInstallation, ApplicationTier, SharePointExtensions, TeamBuild, Tools, VersionControlProxy

Type TfsComponent
Position (Named)
Default Value BaseInstallation
Accept pipeline input False
Accept wildcard characters False

-ComputerName

The machine name of the server where the TFS component is installed. It must be properly configured for PowerShell Remoting in case it’s a remote machine. Optionally, a System.Management.Automation.Runspaces.PSSession object pointing to a previously opened PowerShell Remote session can be provided instead. When omitted, defaults to the local machine where the script is being run

Type string
Position (Named)
Default Value localhost
Accept pipeline input False
Accept wildcard characters False

-Credential

The user credentials to be used to access a remote machine. Those credentials must have the required permission to execute a PowerShell Remote session on that computer and also the permission to access the Windows Registry.

Type PSCredential
Position (Named)
Default Value System.Management.Automation.PSCredential
Accept pipeline input False
Accept wildcard characters False

-Session

The machine name of the server where the TFS component is installed. It must be properly configured for PowerShell Remoting in case it’s a remote machine. Optionally, a System.Management.Automation.Runspaces.PSSession object pointing to a previously opened PowerShell Remote session can be provided instead. When omitted, defaults to the local machine where the script is being run

Type PSSession
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-Version

The TFS version number, represented by the year in its name. For e.g. TFS 2015, use “2015”. When omitted, will default to the newest installed version of TFS / Azure DevOps Server

Type int
Position (Named)
Default Value 0
Accept pipeline input False
Accept wildcard characters False

Outputs

System.String