compwiz32 / PSADHealth

A toolkit of AD specific health checks that you can run in your environment to ensure your Active Directory is running optimally.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove html from function output

mrbodean opened this issue · comments

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

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.