dataplat / dbatools

🚀 SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.39k stars 787 forks source link

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

Closed mwilsonin closed 1 month ago

mwilsonin commented 1 month ago

Type of Change

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 commented 1 month ago

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