Skip to content

Update Restore-RsEncryptionKey.ps1#1

Merged
Gavster4 merged 1 commit intomasterfrom
Fixed-issue-with-Resolve-Path-breaking-UNC-keypaths
Jul 6, 2022
Merged

Update Restore-RsEncryptionKey.ps1#1
Gavster4 merged 1 commit intomasterfrom
Fixed-issue-with-Resolve-Path-breaking-UNC-keypaths

Conversation

@Gavster4
Copy link
Owner

@Gavster4 Gavster4 commented Jul 6, 2022

Fixed issue with Resolve-Path breaking UNC keypaths.

Fixes microsoft#384 .

Changes proposed in this pull request:

  • Changes Resolve-Path to examine the path as a Parent and Child instead of as a single unit to avoid damaging the proper UNC path.

How to test this code:
Restore-RSEncryptionKey -ReportServerInstance "Instance" -Password "Password" -KeyPath "\domain\share\folder\keyfile.snk"
(Testing outside the module requires functions in ShouldProcess.ps1 and ConnectionObjectRequests.ps1)

Has been tested on (remove any that don't apply):

  • PSVersion 5.1.17763.2931
  • Windows Server 2019 Datacenter
  • SQL Server 2016

Fixed issue with Resolve-Path breaking UNC keypaths.
@Gavster4
Copy link
Owner Author

Gavster4 commented Jul 6, 2022

This is to resolve the issue with UNC paths being improperly formatted by the resolve-path. The solution was found on a page by Mike F. Robbins for proper credit. I don't want to paste the url here and have anything flagged as spam but I can include if proper or requested.

@Gavster4 Gavster4 self-assigned this Jul 6, 2022
@Gavster4 Gavster4 merged commit 243256e into master Jul 6, 2022
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.

Issue with Resolve-Path in Restore-RSEncryptionKey

1 participant