Fix remediation output for health tests for certs #542
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request enhances the certificate validation logic in the SDN diagnostic health module by improving how certificate details are collected and reported in several health test functions. The main improvements include standardizing the way certificate properties are gathered and ensuring that results are consistently stored for reporting.
Certificate details collection and reporting:
Test-SdnCertificateExpiredandTest-SdnCertificateMultipleto accumulate certificate details into an array and assign them toPropertiesat the end of execution, ensuring consistent and structured reporting of affected certificates. [1] [2] [3] [4] [5]Test-SdnNonSelfSignedCertificateInTrustedRootStore, introduced a variable to collect certificate details and improved the process of adding certificate information to the result array.Certificate selection logic:
Test-SdnCertificateMultipleto prioritize certificates issued byAzureStackCertificationAuthoritywhen determining which certificate to keep, and improved the remediation message formatting.Change type
Checklist: