Public/System/Out-Verbose.ps1
function Out-Verbose { [CmdletBinding()] [CmdLetTag()] param ( [parameter(Mandatory, ValueFromPipeline)] $VerboseInput, [Switch]$PassThrough ) begin { $items=@() } process { $items+=$VerboseInput } end { if($VerbosePreference -ne "SilentlyContinue") { $items | Out-String -Stream | Write-Verbose } if ($PassThrough) {$items} } } |