Skilled in SEO, content writing, and digital marketing. Completed several years of working in many organizations including multinational companies.
I love to learn new things in life that keep me motivated.
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:
# 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:
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.
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
The
Write-Hostcommand 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 makeWrite-Hostrecognizable on TFS, you can redefine the command in your PowerShell profile.Here is an example of how to do this:
Once you have saved this code in your PowerShell profile, you will be able to use
Write-Hostin 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-Hostin a TFS script: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-Hoston TFS:Write-Hostwill not be colored in the TFS console window.Write-Hostwill be a wrapper forWrite-Information. This means that the output ofWrite-Hostwill be displayed in the information stream, which is not the default stream for TFS.