Skip to content

Commit

Permalink
refactoring to correct for not finding certs correctly in some cases.
Browse files Browse the repository at this point in the history
Signed-off-by: John McCrae <[email protected]>
  • Loading branch information
John McCrae committed May 15, 2022
1 parent df82147 commit f45f53e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/win32/certstore/mixin/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ def cert_ps_cmd(thumbprint, store_location: "LocalMachine", store_name: "My")
<<-EOH
$cert = Get-ChildItem Cert:\\#{store_location}\\#{store_name} -Recurse | Where-Object { $_.Thumbprint -eq "#{thumbprint}" }
if ([string]::IsNullOrEmpty($cert)){
return "Certificate Not Found"
}
$certdata = [System.Convert]::ToBase64String($cert.RawData, 'InsertLineBreaks')
$content = $null
if($null -ne $cert)
Expand Down

0 comments on commit f45f53e

Please sign in to comment.