There is a fundamental difference between outputting data using Write-Host and just "leaving info behind":"
Function test {
Write-Host "Result A"
"Result B"
}
When you run the function, you will get back both results, but Write-Host always directly writes to the console. As such, So you cannot store this result in a variable to process it later.
test
Result A
Result B
$a = test
Result A
$a
Result B
ReTweet this Tip!
Posted
Sep 30 2010, 08:00 AM
by
ps1