powershell tf command not recognized as the name of a cmlet

前端 未结 3 981
Happy的楠姐
Happy的楠姐 2021-01-11 14:29

tf : The term \'tf\' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path

相关标签:
3条回答
  • 2021-01-11 14:33

    You need to include tf.exe full path. For example, you want to check in files with 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

    0 讨论(0)
  • 2021-01-11 14:52

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

    You can check if "tf" is working by typing "tf" in the powershell. If you get an output something as : Microsoft (R) TF - Team Foundation Version Control Tool, Version 14.102.25619.0 Copyright (c) Microsoft Corporation. All rights reserved. ......

    tf is working properly.

    0 讨论(0)
  • 2021-01-11 15:00

    To answer the question form another perspective, this is how you are supposed to call the tf environment variable you created:

    %tf%
    

    I've given it the value C:\Windows\notepad.exe, and the application opens when calling the variable from cmd.

    0 讨论(0)
提交回复
热议问题