Bunion
Bunion

Reputation: 461

Formatting output of Write-verbose

I have a script which when i output an array of file information like this i get the following output

$output
Productversion Fileversion FileName
1.2.3.4         1.2.3.4     test.exe

However when i do output it in the following way

write-verbose $output

I lose the nice output and get everything for each line of $output. Is it possible to format the verbose output to look like standard output? (I need to use write-verbose for a powershell on remote machine TFS task)

Thanks

Upvotes: 2

Views: 762

Answers (1)

mhu
mhu

Reputation: 18041

This should work:

$output | Out-String | Write-Verbose

Upvotes: 4

Related Questions