functionTest-Stream { #region These are all the same and define return values 'Return Value 1' echo'Return Value 2' 'Return Value 3' | Write-Output #endregion
PS C:\> Test-Stream Return Value 1 Return Value 2 Return Value 3 Mandatory User Information WARNING: Warning Information Test-Stream : Error Information At line:1 char:1 + Test-Stream + ~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Test-Stream
PS C:\> $result = Test-Stream Mandatory User Information WARNING: Warning Information Test-Stream : Error Information At line:1 char:1 + Test-Stream + ~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Test-Stream
PS C:\> $result Return Value 1 Return Value 2 Return Value 3
PS C:\> Test-Stream Return Value 1 Return Value 2 Return Value 3 VERBOSE: Additional Information DEBUG: Developer Information Mandatory User Information Auxiliary Information