Test-TargetResource
The Test-TargetResource function is similar to the Get-TargetResource function in that it inspects the current state of the system, but it takes things one step further. After inspecting the current state of the system, it compares it to the expected values provided by the user. Depending on the way the values are specified, it tests to see whether they match.
This function is required to implement all Key, Required, and Write parameters defined in the DSC resource definition file. Key and Required properties are required to be defined as mandatory parameters.
The Test-TargetResource function always returns a Boolean value of either $true or $false. If the target node is in the desired state, the function should return ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access