0

Powershell Export certificate

Hello,
I am using Venafi 19.4
I want to create a script which exports on certificate in P12 format


$URI="https://serverTPP/vedsdk/certificates/Retrieve
$json = @{
"CertificateDN"= "\VED\Policy\Certificats\test"
"Format"="Base64"
}

$hearder= @{
"Authorization" = "Bearer {0}" -f $global:Token.AccessToken
}

$Certificat_pkcs12 = try {
Invoke-RestMethod -Uri $uri -Body $json -Method POST -Headers $hearder
} catch {
Write-host "StatusCode:" $_.Exception.Response.StatusCode.value__
Write-host "StatusDescription:" $_.Exception.Response.StatusDescription
}

I have an error
StatusCode: 415
StatusDescription: Unsupported Media Type

Bests regards

Yann

1 comment

Please sign in to leave a comment.