|

PowerShell Script Signature Fails After Windows Update (2026)

A signed PowerShell script that ran fine last month may now fail its signature check after the November 2026 Windows update.

Microsoft says the update added stricter encoding checks, so scripts that contain invalid UTF-8 can stop validating.

This guide shows how to confirm the cause, re-save the script and sign it again, and it takes about 15 minutes per script.

Quick answer: how to fix a script whose signature now fails

StepWhat to do
1Run Get-AuthenticodeSignature on the script and read the Status
2Open the script in an editor and save it as UTF-8 with a byte order mark (BOM)
3Sign the script again with Set-AuthenticodeSignature
4Check the Status again and test on a second PC

What changed in the November 2026 update?

Microsoft added stricter encoding validation for script signing and signature verification in Windows PowerShell.

Its release notes say scripts with invalid UTF-8 encoding may now fail signature validation, even if they passed before.

The notes tell you to review the affected scripts, save them as UTF-8 with a BOM, and sign them again.

I found this note on Microsoft’s pages for the three November 10, 2026 updates in the table below.

UpdateApplies toBuild
KB5132061Windows 11 26H2 and 25H2, plus 24H2 Enterprise and Education26300.9974, 26200.9974, 26100.9974
KB5132059Windows 11 26H128000.3501
KB5131087Windows 11 23H222631.7711

I did not find the same note on the pages I read for Windows 10, so I am not claiming it applies there.

What does a failing signature look like?

Microsoft documents several signature results, and each one means something different.

StatusMeaning
ValidThe signature is valid and the certificate chain is trusted
NotSignedNo signature block was found
HashMismatchThe file changed after it was signed
NotTrustedThe script is signed, but the root certificate is not trusted on this PC
UnknownErrorVerification failed for another reason

These Status values come from the SignatureStatus list, which the about_Signing page does not spell out.

The update note does not say which Status a failing script will show, so read yours rather than assuming.

Step 1: Check the signature status

Open PowerShell and run the check below, replacing the path with your script.

$sig = Get-AuthenticodeSignature -FilePath .\script.ps1 $sig.Status $sig.StatusMessage

If the Status is Valid, your script is fine and the problem is somewhere else.

If it is anything else, write down the Status and the message before you change the file.

To open PowerShell with administrator rights, see our guide to opening Terminal as administrator.

Step 2: Check your execution policy

Signatures only block scripts when your execution policy requires them.

PolicyWhat it does
RestrictedNo scripts run (the default on first start)
AllSignedScripts must have a digital signature
RemoteSignedLocal unsigned scripts run, but unsigned scripts downloaded from the internet are blocked

Run Get-ExecutionPolicy to see yours.

Microsoft says you change it with Set-ExecutionPolicy from an elevated session, but do not loosen it just to get past this error.

On a work PC, your administrator may set the policy for you, so ask before changing anything.

Step 3: Re-save the script as UTF-8 with BOM

The simplest route follows Microsoft’s update note, which names UTF-8 with a BOM as the target.

In Visual Studio Code, look at the encoding label in the status bar at the bottom, such as UTF-8.

  1. Click the encoding label in the status bar.
  2. Select Save with Encoding.
  3. Choose UTF-8 with BOM.

Microsoft’s encoding guide also lets you make this the default for PowerShell files with the setting below.

“[powershell]”: { “files.encoding”: “utf8bom”, “files.autoGuessEncoding”: true }

A BOM is a few bytes at the start of a file that tell a program which encoding the text uses.

Without one, Windows PowerShell 5.1 usually reads the file as Windows-1252 on an en-US PC, according to Microsoft.

Step 4: Sign the script again

Any edit after signing invalidates the signature, and re-saving in a new encoding counts as an edit.

Set-AuthenticodeSignature replaces any existing signature when it runs, so you can sign the same file again.

$cert = Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert | Select-Object -First 1 Set-AuthenticodeSignature -FilePath .\script.ps1 -Certificate $cert -HashAlgorithm SHA256

Certificates without a private key cannot be used for signing, so the command fails if yours lacks one.

Microsoft says the default hash is SHA1 before PowerShell 7.3, so adding the SHA256 option keeps results consistent.

Use a certificate from a certification authority for scripts you share, because Microsoft says self-signed ones are for testing only.

Should you add a timestamp?

A signature stays valid until the signing certificate expires, and a timestamp server lets it outlast that date.

Add the TimestampServer option with an http address from your certificate provider.

Microsoft warns that PowerShell 7.3 accepts https addresses but the underlying API does not support them, so the file is signed without a timestamp and an error appears.

Step 5: Verify and test the result

Run Get-AuthenticodeSignature again and confirm the Status reads Valid.

Then run the script on a second PC that uses the same execution policy, because a pass on the signing PC is not proof it works elsewhere.

If you ever sign on one PC and run on another with a different system locale, read the next section.

Why a script with special characters can fail on another PC

Microsoft documents a separate hash mismatch problem for scripts with characters such as ö, ä or ü.

It happens when the script is saved as ASCII or UTF-8, signed under one system locale, and run under another.

The error says the file might have been changed because its hash does not match the hash stored in the signature.

EncodingResult on Windows 10 and 11, per Microsoft
ASCIIAffected by the locale problem
UTF-8Affected by the locale problem
UTF-16 BE with BOMSet-AuthenticodeSignature fails with UnknownError
UTF-16 LE with BOMNot affected

That page fixes it by removing special characters or by saving as UTF-16 LE with BOM.

What do Microsoft’s pages disagree on?

The about_Signing page says that before PowerShell 7.2, a script must be saved as ASCII or UTF8NoBOM to be signed.

That wording conflicts with the update note, which asks for UTF-8 with a BOM, and I could not find Microsoft reconciling the two.

Treat Get-AuthenticodeSignature as the judge, and test one script before you re-sign a whole folder.

Can you uninstall the update instead?

You can, but it also removes the November security fixes, so fixing the script is the better route.

Our guide to uninstalling a Windows update covers the steps if you still need them.

To confirm which build you run, see how to check your Windows version.

For other problems with the same release, read our KB5132061 install errors guide.

When to contact Microsoft or your administrator

Contact your IT administrator if a managed PC enforces AllSigned and a re-signed script still fails.

For other cases, Microsoft’s hash mismatch article points to its TSS tool for collecting diagnostics before you contact support.

Official sources: Microsoft KB5132061 page, about_Signing, Set-AuthenticodeSignature, file encoding guide, hash mismatch article.

Leave a Reply

Your email address will not be published. Required fields are marked *