compwiz32 / PSADHealth

A toolkit of AD specific health checks that you can run in your environment to ensure your Active Directory is running optimally.
GNU General Public License v2.0
149 stars 19 forks source link

Remove html from function output #66

Open mrbodean opened 5 years ago

mrbodean commented 5 years ago

By making the output more generic it will support multiple output plugins without needing to reformat multiple times in the function code.

mrbodean commented 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.

compwiz32 commented 5 years ago

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.