# Export-CertificateForNuGet

Exports a code-signing certificate to DER format for NuGet.org registration.

Project

PSPublishModule

Build, test, version, sign, and publish PowerShell modules with reusable PowerForge pipelines.

[View on GitHub](https://github.com/EvotecIT/PSPublishModule) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSPublishModule/releases/tag/v3.0.124) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSPublishModule/2.0.27)

Stars **48**

Forks **15**

Open issues **1**

PowerShell Gallery downloads **17,213**

Release **v3.0.195**

Language: C# Updated: 2026-11-25

Command 

**Module**

`PSPublishModule`

**Inputs**

`None`

**Outputs**

`PowerForge.NuGetCertificateExportResult`

Exports a code-signing certificate to DER format for NuGet.org registration.

## Syntax

```
Export-CertificateForNuGet
-CertificateThumbprint <String>
[-LocalStore <CurrentUser|LocalMachine>]
[-OutputPath <String>]
[<CommonParameters>]
```

[#](#method-export-certificatefornuget-string-certificatestorelocation-string)

Parameter set: `Thumbprint`

```
Export-CertificateForNuGet
-CertificateSha256 <String>
[-LocalStore <CurrentUser|LocalMachine>]
[-OutputPath <String>]
[<CommonParameters>]
```

[#](#method-export-certificatefornuget-string-certificatestorelocation-string-2)

Parameter set: `Sha256`

## Description

NuGet.org requires uploading the public certificate (.cer) used for package signing. This cmdlet exports the selected certificate from the local certificate store.

## Examples

### Export by thumbprint

```powershell
Export-CertificateForNuGet -CertificateThumbprint '0123456789ABCDEF' -OutputPath (Join-Path $env:TEMP 'NuGetSigning.cer')
```

Exports the certificate in DER format to the given path.

### Export by SHA256 hash

```powershell
Export-CertificateForNuGet -CertificateSha256 '0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF'
```

Useful when you have the SHA256 fingerprint but not the Windows thumbprint.

## Parameters

**-CertificateThumbprint String requiredsets: Thumbprint**

The SHA1 thumbprint of the certificate to export.

**-LocalStore CertificateStoreLocation optional**

Certificate store location to use.

Possible values: `CurrentUser`, `LocalMachine`

**-OutputPath String optional**

Output path for the exported .cer file.

**-CertificateSha256 String requiredsets: Sha256**

The SHA256 hash of the certificate to export.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:187C91379BCF2399683A37B6E492B9388337FFC53FCF51ABCF0B3D1E840EBE2C -->
