Skip to content

Commit 290ce4f

Browse files
author
Cristian Mezzetti
committed
Added condition at the top of the inspect script in order to check if the certificate is already installed without creating a certificate object
1 parent 14fe4c6 commit 290ce4f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

templates/inspect.ps1.erb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
$is_already_installed = Get-ChildItem -Path cert:\<%= @root_store %>\<%= @store_dir %> -Recurse | select thumbprint | where { $_.thumbprint -eq '<%= @thumbprint %>' }
2+
3+
if ([string]::IsNullOrEmpty($is_already_installed) -eq $False) {
4+
Remove-Item $MyINvocation.InvocationName
5+
exit 1
6+
}
7+
18
$pfx = new-object System.Security.Cryptography.X509Certificates.X509Certificate2
29

310
$certificate = gi "<%= @location %>\<%= @name %>"

0 commit comments

Comments
 (0)