Share via


Using tf.exe in PowerShell ISE or other custom environments

Recently a few folks from our and other team tried working with TFS inside PowerShell ISE (https://blogs.microsoft.co.il/blogs/scriptfanatic/archive/2008/12/30/windows-powershell-integrated-scripting-environment-ise.aspx).
What they discovered is that tf.exe thinks that its output is redirected and switches to noprompt mode. Which means that running
tf.exe checkin

will check in the code instead of bringing up UI. Ouch.
The problem is that ISE is really redirecting the output of tf.exe in order to display it. tf.exe is trying to be smart and suppress UI if it detects it. Fortunately there is easy workaround since TFS 2008.
If you set environment variable:
TFS_IGNORESTDOUTREDIRECT=1

We will stop detecting output redirection. You need to add /noprompt to force no ui mode.

Hope this helps :)