Returning output from a WebDeploy cmd

Apr 26, 2011 at 3:44 PM

I have a PowerShell script that executes a WebDeploy cmd.  When I run it from the console I can see the output just fine but I don't see the output in the email.  Is there a way to capture that output and return it via the email?

Apr 27, 2011 at 12:47 AM

I answered by own question with the following:

& $deployCmd /y /M:$DeployMachineURI /U:$DeployUserName /P:$DeployPassword /a:basic  2>&1 | out-file DeployOutput.txt
get-content -path DeployOutput.txt