# Register-Certificate

Signs files in a path using a code-signing certificate (Windows and PowerShell Core supported).

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`

Signs files in a path using a code-signing certificate (Windows and PowerShell Core supported).

## Syntax

```
Register-Certificate
[-ExcludePath <String[]>]
[-HashAlgorithm <SHA1|SHA256|SHA384|SHA512>]
[-Include <String[]>]
[-IncludeChain <All|NotRoot|Signer>]
-LocalStore <CurrentUser|LocalMachine>
-Path <String>
[-Thumbprint <String>]
[-TimeStampServer <String>]
[<CommonParameters>]
```

[#](#method-register-certificate-string-certificatehashalgorithm-string-certificatechaininclude-certificatestorelocation-string-string-string)

Parameter set: `Store`

```
Register-Certificate
-CertificatePFX <String>
[-ExcludePath <String[]>]
[-HashAlgorithm <SHA1|SHA256|SHA384|SHA512>]
[-Include <String[]>]
[-IncludeChain <All|NotRoot|Signer>]
-Path <String>
[-TimeStampServer <String>]
[<CommonParameters>]
```

[#](#method-register-certificate-string-string-certificatehashalgorithm-string-certificatechaininclude-string-string)

Parameter set: `PFX`

## Description

Signs PowerShell scripts/manifests (and optionally binaries) using Authenticode. When running in CI, prefer using a certificate from the Windows certificate store and referencing it by thumbprint.

## Examples

### Sign a module using a certificate from the current user store

```powershell
Register-Certificate -Path 'C:\Git\MyModule\Module' -LocalStore CurrentUser -Thumbprint '0123456789ABCDEF' -WhatIf
```

Previews which files would be signed.

### Sign using a PFX file

```powershell
Register-Certificate -CertificatePFX 'C:\Secrets\codesign.pfx' -Path 'C:\Git\MyModule\Module' -Include '*.ps1','*.psm1','*.psd1'
```

Uses a PFX directly (useful for local testing; store-based is recommended for CI).

## Parameters

**-ExcludePath String[] optional**

One or more path substrings to exclude from signing.

**-HashAlgorithm CertificateHashAlgorithm optional**

Hash algorithm used for the signature. Default: SHA256.

Possible values: `SHA1`, `SHA256`, `SHA384`, `SHA512`

**-Include String[] optional**

File patterns to include during signing. Default: scripts only.

**-IncludeChain CertificateChainInclude optional**

Which portion of the chain to include in the signature. Default: All.

Possible values: `All`, `NotRoot`, `Signer`

**-LocalStore CertificateStoreLocation requiredsets: Store**

Certificate store to search when using a certificate from the store.

Possible values: `CurrentUser`, `LocalMachine`

**-Path String required**

Root directory containing files to sign.

**-Thumbprint String optionalaliases: CertificateThumbprintsets: Store**

Certificate thumbprint to select a single certificate from the chosen store.

**-TimeStampServer String optional**

RFC3161 timestamp server URL. Default: http://timestamp.digicert.com.

**-CertificatePFX String requiredsets: PFX**

A PFX file to use for signing (mutually exclusive with -LocalStore/-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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:DDCB350609C6BA83405CE54C59F640A5E2EFB86FFC3EEC92027D377710F2067E -->
