Skip to content
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

Update Set-DbaNetworkCertificate to work with PowerShell Core when using RSA certificates #9342

Merged
merged 2 commits into from
May 10, 2024

Conversation

mwilsonin
Copy link
Contributor

@mwilsonin mwilsonin commented May 8, 2024

Type of Change

  • Bug fix (non-breaking change, fixes # )
  • New feature (non-breaking change, adds functionality, fixes # )
  • Breaking change (affects multiple commands or functionality, fixes # )
  • Ran manual Pester test and has passed (.\tests\manual.pester.ps1)
  • Adding code coverage to existing functionality
  • Pester test is included
  • If new file reference added for test, has is been added to github.com/dataplat/appveyor-lab ?
  • Unit test is included
  • Documentation
  • Build system

Purpose

Set-DbaNetworkCertificate errors on PowerShell Core when using RSA certificates due to a difference in certificate object properties between Desktop and Core editions.

Approach

Add an Edition check at the appropriate place to get the proper value to calculate the certificate path.

Commands to test

Using an RSA certificate, run the same command on Windows PowerShell and PowerShell Core (7) and observe the results. The PowerShell Core will fail.

Set-DbaNetworkCertificate -SqlInstance server\instance -Thumbprint 'thumbprintofcertificate'

Screenshots

WindowsPowerShell-vs-PowerShell

Learning

@potatoqualitee
Copy link
Member

this is nice, thank you so much! i will merge it but it may be a couple days before release 👍🏼

@potatoqualitee potatoqualitee merged commit 866a66f into dataplat:development May 10, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants