Powershell tf command not recognized as cmlet name

tf: The term "tf" is not recognized as a cmdlet name, function, script file, or operating program. Check the spelling of the name, or if the path was included, make sure the path is correct and try again.

I set the environment variable but it does not work. The tf command works on the Developer Command Prompt command line for VS2013, but does not work on Powershell. How can I make this work? enter image description here

+5
source share
2 answers

You need to include the full path of tf.exe. For example, you want to check files using the tf checkin command in PowerShell:

$filePath = "C:\Users\username\Source\Workspaces\teamproject\solutionname\projectname\Class1.cs" Set-Alias tfs "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\tf.exe" tfs checkin $filePath /noprompt 
+6
source

It worked for me. I added the TF.exe path ("C: \ Program Files (x86) \ Microsoft Visual Studio 14.0 \ Common7 \ IDE" in my case) to the PATH system variable variable (through "My Computer"> "Properties"> "Advanced System Settings "> Environment Variables-> System Variables-> Path-> Edit).

You can check if "tf" works by typing "tf" on the command line. If you get something like: Microsoft (R) TF - Team Foundation version control tool, version 14.102.25619.0 Copyright (c) Microsoft Corporation. All rights reserved. ......

tf is working correctly.

+1
source

Source: https://habr.com/ru/post/1234749/


All Articles