Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #This might work with w8 or w10, not tested.
- #Default params if no input given.
- param(
- [String]$certName,
- [String]$certRootStore = "LocalMachine",
- [String]$certStore = "root"
- )
- #Cert repo
- $file=("\\namespace\it\deploy\certificates\" + $certName)
- #Only proceed if cert exists on fileshare
- If (Test-Path $file){
- $pfx=new-object System.Security.Cryptography.X509Certificates.X509Certificate2
- $pfx.import $file
- $store= new-object System.Security.Cryptography.X509Certificates.X509Store($certStore,$certRootStore)
- $store.open("MaxAllowed")
- $store.add($pfx)
- $store.close()
- }Else{
- exit 1
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement