Last active
September 26, 2019 17:42
-
-
Save AlexAsplund/0007914a0054ac0e22cf2e6bc600ed66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function New-AdhcResult { | |
[cmdletbinding()] | |
param( | |
# Source of the result. The computer that was tested | |
[parameter(ValueFromPipelineByPropertyName)] | |
[string]$Source = $env:COMPUTERNAME, | |
# Name of the test | |
[parameter(Mandatory,ValueFromPipelineByPropertyName)] | |
[string]$TestName, | |
# True = Test pass | |
[parameter(Mandatory,ValueFromPipelineByPropertyName)] | |
[bool]$Pass, | |
[parameter(ValueFromPipelineByPropertyName)] | |
$Was, | |
[parameter(ValueFromPipelineByPropertyName)] | |
$ShouldBe, | |
# General category of the test. Like "Directory Services" or "DNS" | |
[parameter(Mandatory,ValueFromPipelineByPropertyName)] | |
[string]$Category, | |
# A more specific subcategory like "FSMO" or "DNS Forwarding" | |
[parameter(Mandatory,ValueFromPipelineByPropertyName)] | |
[string]$SubCategory, | |
# Tags for this test like "Security", "Updates", "Logon" | |
[parameter(Mandatory,ValueFromPipelineByPropertyName)] | |
[string[]]$Tags, | |
# General message | |
[parameter(ValueFromPipelineByPropertyName)] | |
[string]$Message, | |
# Extra data to the test result. Like accountnames or SPN's etc. | |
[parameter(ValueFromPipelineByPropertyName)] | |
$Data | |
) | |
Begin { | |
} | |
Process { | |
[AdhcResult]@{ | |
Source = $Source | |
TestName = $TestName | |
Pass = $Pass | |
Was = $Was | |
ShouldBe = $ShouldBe | |
Category = $Category | |
SubCategory = $SubCategory | |
Message = $Message | |
Data = $Data | |
Tags = $Tags | |
} | |
} | |
End { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment