When you leave data behind, PowerShell automatically returns it to the caller. This may create strange-looking code. With Write-Output, you can explicitly assign your return values. These two examples work the same:
Function testA {
'My Result'
}
Function testB {
Write-Output 'My Result'
}
ReTweet this Tip!
Posted
Oct 01 2010, 08:00 AM
by
ps1