From 01c88d0ba05f32970b22d95d0e176a4b7c7346df Mon Sep 17 00:00:00 2001 From: John McCrae Date: Tue, 23 Nov 2021 15:26:53 -0800 Subject: [PATCH] Properly accounted for Linux/Mac style thumbprint structures Signed-off-by: John McCrae --- lib/win32/certstore/store_base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/win32/certstore/store_base.rb b/lib/win32/certstore/store_base.rb index 1b7ad58..3ed2c2f 100644 --- a/lib/win32/certstore/store_base.rb +++ b/lib/win32/certstore/store_base.rb @@ -264,7 +264,7 @@ def get_cert_pem(thumbprint, store_name: @store_name, store_location: @store_loc end get_data = powershell_exec!(cert_ps_cmd(thumbprint, store_location: converted_store, store_name: store_name), :powershell, timeout: timeout) get_data.result - rescue Chef::PowerShell::CommandFailed + rescue Chef_PowerShell::PowerShellExceptions::PowerShellCommandFailed raise ArgumentError, "PowerShell threw an error retreiving the certificate. You asked for a cert with this thumbprint : #{thumbprint}, located in this store : #{store_name}, at this location : #{store_location}" end