Skip to content

Commit b52d5db

Browse files
authored
Merge pull request #70 from cmezzett/issue-33
Checks if the certificate is installed without creating an object
2 parents 20c76a1 + 290ce4f commit b52d5db

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)