Open mrbodean opened 5 years ago
Using a structued Object that each script or fuction would return to the pipeline makes the most sense to me. Something like $object = New-Object -TypeName PSObject $object | Add-Member -MemberType NoteProperty -Name ComputerName -Value "XXX" $object | Add-Member -MemberType NoteProperty -Name MessageType -Value "Info" # or "Error" $object | Add-Member -MemberType NoteProperty -Name MessageText -Value "Powershell rocks and I would have spent 30 minutes doing this check by hand"
With a core set or required messages for all functions you could add parsing logic in the in the output plugins to format as desired or to just pull the relevant data into a template message for specific message types.
we decided we're going to work on this after the summit. it's a pretty decent amount of code rewrite and the timing right now for a major change isn't so awesome.
By making the output more generic it will support multiple output plugins without needing to reformat multiple times in the function code.