---
title: "How to make a write-host recognizable on TFS?"  
description: "How to make a write-host recognizable on TFS?"  
author: "Revati S Misra"  
published: 2023-08-02  
updated: 2023-08-03  
canonical: https://www.mindstick.com/forum/159441/how-to-make-a-write-host-recognizable-on-tfs  
category: "visual studio"  
tags: ["team foundation server", "visual studio", "troubleshooting"]  
reading_time: 2 minutes  

---

# How to make a write-host recognizable on TFS?

How to make a write-[host](https://yourviews.mindstick.com/view/85456/foreign-direct-investment-fdi-and-its-impacts-on-host-countries) recognizable on [TFS](https://www.mindstick.com/forum/440/tfs-installation-and-configuration-using-vs-2010)?

## Replies

### Reply by Aryan Kumar

The `Write-Host` command is not recognized by TFS by default. This is because TFS uses a different version of PowerShell than the one that is installed on your local machine. To make `Write-Host` recognizable on TFS, you can redefine the command in your PowerShell profile.

Here is an example of how to do this:

```plaintext
# This redefines the Write-Host command to use Write-Verbose
function Write-Host {
    Write-Verbose $args
}
```

Once you have saved this code in your PowerShell profile, you will be able to use `Write-Host` in your TFS scripts. The output of the command will be displayed in the TFS console window.

Here is an example of how to use `Write-Host` in a TFS script:

```plaintext
Write-Host "This is a message from Write-Host"
```

This will display the message "This is a message from Write-Host" in the TFS console window.

Here are some additional things to keep in mind when using `Write-Host` on TFS:

- The output of `Write-Host` will not be colored in the TFS console window.

   - If you are using a version of PowerShell that is older than 5.0, `Write-Host` will be a wrapper for `Write-Information`. This means that the output of `Write-Host` will be displayed in the information stream, which is not the default stream for TFS.


---

Original Source: https://www.mindstick.com/forum/159441/how-to-make-a-write-host-recognizable-on-tfs

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
