Skip to content

Commit

Permalink
Added the -Force command to ensure proper searches
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 17, 2022
1 parent 401b8d2 commit 70da978
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/win32/certstore/mixin/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module Helper
def cert_ps_cmd(thumbprint, store_location: "LocalMachine", store_name: "My")
# the PowerShell block below uses a "Here-String" - it is explicitly formatted against the left margin.
<<-EOH
$cert = Get-ChildItem Cert:\\#{store_location}\\#{store_name} -Recurse | Where-Object { $_.Thumbprint -eq "#{thumbprint}" }
$cert = Get-ChildItem Cert:\\#{store_location}\\#{store_name} -Recurse -Force | Where-Object { $_.Thumbprint -eq "#{thumbprint}" }
if ([string]::IsNullOrEmpty($cert)){
return "Certificate Not Found"
Expand Down

0 comments on commit 70da978

Please sign in to comment.