HowTo: Grab powershell output?

Jun 20, 2011 at 6:22 PM

any idea how we can log the the output of the powershell task?

 

this way is too explicit:

 

CDATA[ 
$log.LogMessage([Microsoft.Build.Framework.MessageImportance]"High", "Hello from PowerShell! Now adding {0} and {1}.", $first, $second)

if ($first + $second -gt 100) { 
	$log.LogError("Oops! I can't count that high. :(") 
$sum = $first + $second 
]]

how can we just get the output from other instructions? or everything we would get in a normal console?

Developer
Oct 11, 2011 at 10:34 AM

See http://tfsbuildextensions.codeplex.com/wikipage?title=How%20to%20integrate%20the%20InvokePowerShellCommand%20build%20activity&referringTitle=Documentation