all scripts

This commit is contained in:
Alexpolo1
2023-03-09 09:06:25 +01:00
parent 49b677d254
commit bf7c3012b7
115 changed files with 68517 additions and 0 deletions

17
import_export_starew.ps1 Normal file
View File

@@ -0,0 +1,17 @@

#not Tested
$certificate = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("C:\Users\a.warme\Downloads\star.east-west.dk-2024-02-05\star.east-west.dk-2024-02-05.pfx","thales")
$store = New-Object System.Security.Cryptography.X509Certificates.X509Store("My", "LocalMachine")
$store.Open("ReadWrite")
$store.Add($certificate)
$store.Close()
$CertStore = New-Object System.Security.Cryptography.X509Certificates.X509Store("My", "LocalMachine")
$CertStore.Open("ReadOnly")
$Certificate = $CertStore.Certificates | Where-Object {$_.Subject -eq "CN=star.east-west.dk"}
$Base64 = [System.Convert]::ToBase64String($Certificate.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Cert))
Write-Output $Base64