In this comprehensive tutorial, you will learn how to digitally sign a Powershell script. This step-by-step guide will provide you with all the necessary information to successfully Sign a Powershell script.
• Windows 2012 R2
• Windows 2016
• Windows 2019
• Windows 2022
• Windows 10
• Windows 11
Equipment list
Here you can find the list of equipment used to create this tutorial.
This link will also show the software list used to create this tutorial.
Related tutorial – PowerShell
On this page, we offer quick access to a list of tutorials related to PowerShell.
Tutorial – Digitally sign Powershell scripts
Start a Powershell command-line.
Create a self-signed certificate using Powershell
List the certificates in the current user’s personal store.
Here is the command output.
Export the public key of the certificate.
Here is the command output.
Start an elevated Powershell command line.
Import this certificate as a trusted root certification authority.
Import this certificate as a trusted publisher.
Access the certificate file and verify if the system trusts it.
Create a Powershell script.
Here is our Script content.
Digitally sign the Powershell script.
Here is the command output.
Access the Powershell Script properties and verify if the system trusts it.
There are multiple ways to digitally sign the Powershell script.
Congratulations! You are able to create digitally signed Powershell Scripts.
Tutorial Powershell – Testing digitally signed Scripts
Change the Powershell execution policy to allow only signed scripts.
Execute our digitally signed Powershell script.
Execute a Powershell script not digitally signed.
Congratulations! You are able to run digitally signed Powershell Scripts.