Evotec

Project

PSPublishModule

PSPublishModule is an open-source PowerShell and .NET project with packages, release history, and technical documentation.

Stars 43
Forks 13
Open issues 1
PowerShell Gallery downloads 13,876
Release v3.0.3
Language: C# Updated: 2026-04-14

API Reference

Cmdlet

Export-CertificateForNuGet

Namespace PSPublishModule
Inputs
None
Outputs
PowerForge.NuGetCertificateExportResult

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

Remarks

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

Examples

Authored help example

Export by thumbprint

PS>


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

PS>


Export-CertificateForNuGet -CertificateSha256 '0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF'
        

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

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.

Syntax

Export-CertificateForNuGet -CertificateThumbprint <String> [-LocalStore <CurrentUser|LocalMachine>] [-OutputPath <String>] [<CommonParameters>]
#
Parameter set: Thumbprint

Parameters

CertificateThumbprint String requiredposition: namedpipeline: False
The SHA1 thumbprint of the certificate to export.
LocalStore CertificateStoreLocation optionalposition: namedpipeline: Falsevalues: 2
Certificate store location to use.
Possible values: CurrentUser, LocalMachine
OutputPath String optionalposition: namedpipeline: False
Output path for the exported .cer file.

Outputs

PowerForge.NuGetCertificateExportResult

Export-CertificateForNuGet -CertificateSha256 <String> [-LocalStore <CurrentUser|LocalMachine>] [-OutputPath <String>] [<CommonParameters>]
#
Parameter set: Sha256

Parameters

CertificateSha256 String requiredposition: namedpipeline: False
The SHA256 hash of the certificate to export.
LocalStore CertificateStoreLocation optionalposition: namedpipeline: Falsevalues: 2
Certificate store location to use.
Possible values: CurrentUser, LocalMachine
OutputPath String optionalposition: namedpipeline: False
Output path for the exported .cer file.

Outputs

PowerForge.NuGetCertificateExportResult