-
-
Notifications
You must be signed in to change notification settings - Fork 860
Get-DbaNetworkConfiguration: Add SuitableCertificate property to output #10143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@claude please review my pull request. |
|
Claude finished @andreasjordan's task in 2m 15s —— View job Code ReviewSummaryThis PR adds a Findings✅ Strengths
|
|
I will add a commit to fix "Must fix: DNS name array handling" based on the feedback from claude. I will also include a try catch block as a savety net. |
|
@claude please have a look at my last comment and my last commit and see if I made a mistake. |
|
Claude finished @andreasjordan's task in 48s —— View job Review of Latest Commit ✅
SummaryThe latest commit looks excellent! Both fixes have been implemented correctly and I found no mistakes in the implementation. What Was Fixed1. ✅ DNS Name Array Handling (Line 245)Previous code: if (-not $dnsNames -and $_.Subject -match 'CN=([^,]+)') { $dnsNames = $Matches[1] }Fixed code: if (-not $dnsNames -and $_.Subject -match 'CN=([^,]+)') { $dnsNames = @( $Matches[1] ) }Status: Perfect fix! The 2. ✅ Try-Catch Safety Net (Lines 240-261)The entire certificate validation logic is now wrapped in a try-catch block that:
Status: Excellent implementation! The error logging includes the certificate thumbprint which will be helpful for debugging, and the function gracefully continues processing other certificates. Code Quality AssessmentThe implementation demonstrates good defensive programming practices:
No Issues FoundI reviewed the entire certificate validation logic and found no mistakes or problems with the implementation. The code follows PowerShell best practices and the dbatools style guide. RecommendationThis PR is ready to merge from a code quality perspective. The implementation correctly:
|
|
looks clean and new name is suitable |
Type of Change
Invoke-ManualPester)Purpose
The plan is to refactor Set-DbaNetworkCertificate and use Get-DbaNetworkConfiguration to test for suitable but currently not configured certificates.
I also plan a new command Test-DbaNetworkCertificate to test both validity of the currect configured certificate and also the existance of suitable new certificates.
Approach
I worked with Copilot and ChatGPT on implementing the correct tests, but I am not 100 percent sure if everything is correct.
I think the best approach is to include this in the next release of dbatools and ask users to test this in their environment and give feedback. The new code with the tests can also be used without dbatools by just using the relevant lines of code.