From fe6ff27ffa194ed1cad7510b5d5533db0bc04463 Mon Sep 17 00:00:00 2001 From: asesidaa <1061472754@qq.com> Date: Sun, 26 Feb 2023 00:10:53 +0800 Subject: [PATCH] Add import script --- MainServer/BundledCertificates/Import.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 MainServer/BundledCertificates/Import.ps1 diff --git a/MainServer/BundledCertificates/Import.ps1 b/MainServer/BundledCertificates/Import.ps1 new file mode 100644 index 0000000..e83cf20 --- /dev/null +++ b/MainServer/BundledCertificates/Import.ps1 @@ -0,0 +1,13 @@ +param ( + [switch]$WhatIf = $false +) +$certsInMy = Get-ChildItem Cert:\LocalMachine\My +$certsInMy | Where-Object {$_.Issuer -match "Taito Arcade Machine CA"} | Remove-Item -WhatIf:$WhatIf + +$certsInRoot = Get-ChildItem Cert:\LocalMachine\Root +$certsInRoot | Where-Object {$_.Issuer -match "Taito Arcade Machine CA"} | Remove-Item -WhatIf:$WhatIf + +Get-ChildItem -Path root.pfx | Import-PfxCertificate -CertStoreLocation Cert:\LocalMachine\My -WhatIf:$WhatIf +Get-ChildItem -Path cert.pfx | Import-PfxCertificate -CertStoreLocation Cert:\LocalMachine\My -WhatIf:$WhatIf + +Get-ChildItem -Path root.pfx | Import-PfxCertificate -CertStoreLocation Cert:\LocalMachine\Root -WhatIf:$WhatIf \ No newline at end of file