PowerShell Script Not Working After KB5132061? 6 Fast Fixes

PowerShell script not working after KB5132061 with Get-AuthenticodeSignature reporting NotSigned on Windows 11

Is your PowerShell script not working after KB5132061? Microsoft's November 10, 2026 Windows security update introduced stricter encoding validation for signed PowerShell scripts. As a result, certain previously signed scripts containing malformed UTF-8 or incompatible text encoding can fail signature verification.

On affected Windows 11 24H2, 25H2, and 26H2 systems, Get-AuthenticodeSignature may return NotSigned, while Set-AuthenticodeSignature may report UnknownError. Some affected scripts may also encounter ConstrainedLanguage restrictions on devices using Windows Defender Application Control (WDAC). Microsoft recommends investigating encoding problems and, when appropriate, converting scripts to valid UTF-8 with BOM before signing them again.

However, not every PowerShell script failure is caused by KB5132061. Execution policies, blocked downloaded files, incorrect directory paths, Task Scheduler settings, and differences between Windows PowerShell 5.1 and PowerShell 7 can produce similar symptoms. This guide explains six ways to troubleshoot a PowerShell script that will not run, starting with non-destructive checks.

Quick Fix: PowerShell Script Not Working After KB5132061

If a previously signed PowerShell script stopped working after KB5132061, check its Authenticode signature first. If Microsoft’s encoding diagnostic tool identifies a problem, create a repaired or converted copy, verify its signature, and test it before deployment. Do not disable script security policies to hide the error.

  1. Check the signature: Run Get-AuthenticodeSignature against the affected script.
  2. Diagnose encoding: Use Microsoft's Repair-SignedPowerShellUtf8.ps1 utility in read-only Scan mode.
  3. Repair only when indicated: Use the supported repair or UTF-8-with-BOM conversion procedure for the specific encoding issue.
  4. Verify execution settings: If the error says script execution is disabled, review Get-ExecutionPolicy -List.
  5. Check file paths: If the script works manually but fails in Task Scheduler, investigate its working directory and executable path.

Important: Keep an untouched copy of the original script, especially if it is signed, distributed to other computers, or used in production. Editing a signed script can invalidate its signature.

Why Did PowerShell Scripts Stop Working After KB5132061?

Microsoft's November 10, 2026 security update KB5132061 includes a Windows PowerShell security change affecting script signing and signature verification.

PowerShell Authenticode signatures help verify the identity of a script's signer and whether signed content has been modified. Windows must interpret a script's text encoding when it validates the signature.

The November security hardening introduces stricter handling of invalid text encoding. Some files that were previously accepted can now fail verification if Windows detects malformed UTF-8 or a mismatch involving the selected text encoding.

Microsoft documents three relevant symptom categories:

SymptomWhat It May IndicateWhat to Check
NotSignedWindows does not recognize a valid Authenticode signature for the file.Signature status, original signed copy, and encoding scan
UnknownErrorA signing operation failed. Certain encoding errors can cause this result.Full error message and source encoding
ConstrainedLanguagePowerShell execution is restricted under an application control policy.App Control policy, file trust, and signature validation
Running scripts is disabledExecution policy may prevent the script from running.Effective policy and Group Policy precedence
File or command not foundScript directory, relative file path, executable location, or environment PATH may be incorrect.Working directory, script paths, and Task Scheduler action

NotSigned alone does not prove an encoding problem. A file may be unsigned, altered after signing, signed incorrectly, or affected by another verification issue. A diagnosis should consider the full signature status and the script's history.

The official update documentation is available in Microsoft's KB5132061 release notes.

Method 1: Check Your PowerShell Script Signature

If your PowerShell script is not working after KB5132061, begin by checking whether Windows still recognizes its signature.

This step does not modify the script and can help distinguish a signature problem from an ordinary execution or path error.

Step 1: Open Windows PowerShell

  1. Open the Start menu.
  2. Search for Windows PowerShell.
  3. Open Windows PowerShell 5.1 or the terminal used to run your script.
  4. Locate the script you want to inspect.
  5. For the examples below, assume the file is stored at C:\Scripts\Deploy.ps1.

Step 2: Run Get-AuthenticodeSignature

Run the following command, replacing the example path with the actual location of your script:

Get-AuthenticodeSignature -FilePath "C:\Scripts\Deploy.ps1" | Format-List Status, StatusMessage, SignerCertificate

PowerShell returns the signature status and related information. Relevant outcomes include:

  • Valid: The script's Authenticode signature passed verification in the current environment.
  • NotSigned: A valid signature was not identified. This does not, by itself, identify the reason.
  • HashMismatch: The file content may differ from what was originally signed.
  • UnknownError: The verification process encountered an error that requires further investigation.
PowerShell Get-AuthenticodeSignature command displaying a NotSigned status during script signature troubleshooting
Use Get-AuthenticodeSignature to inspect a PowerShell script's signature before attempting any encoding changes.

Step 3: Compare the Script with Its Original Version

If the script was previously signed, compare the affected file with a trusted original copy. Determine whether it was recently edited, reformatted, downloaded again, or modified by an automated deployment process.

You can calculate a file hash to help compare files:

Get-FileHash -Path "C:\Scripts\Deploy.ps1" -Algorithm SHA256

Different hashes show that the file bytes differ, but do not establish why they changed. Compare the result with a known trusted version when available.

If a previously signed file returns NotSigned after the security update, proceed to Microsoft's read-only encoding scan in Method 3 before choosing a repair.

For command details, see Microsoft Learn: Get-AuthenticodeSignature.

Method 2: Convert the Script to UTF-8 with BOM and Re-Sign It

For a confirmed PowerShell encoding problem, Microsoft recommends creating a file with valid UTF-8 encoding and a byte order mark (BOM), reviewing the resulting text, and signing it again.

However, simply adding a BOM does not repair malformed UTF-8 bytes. Converting text using the wrong source encoding can also change characters and break script logic.

For signed production scripts, the recommended approach is to use the official Microsoft conversion utility described in Method 3. The following editor-based procedure is suitable when you know the original text encoding and have an authorized way to sign the resulting copy.

Step 1: Make a Backup Copy

Keep the original signed script unchanged. Make a separate working copy before modifying its encoding.

Copy-Item -LiteralPath "C:\Scripts\Deploy.ps1" -Destination "C:\Scripts\Deploy.backup.ps1"

If the destination already exists, choose another backup filename. Do not overwrite your only known good copy.

Step 2: Review the Original Text Encoding

Open a working copy in a trusted text editor such as Visual Studio Code. Check its existing encoding and inspect any non-ASCII characters, including accented letters, comments, and string literals.

Do not assume that a file containing unusual characters is automatically malformed UTF-8. Legacy code pages and other valid encodings may require conversion using the correct original encoding.

Step 3: Save the Corrected Copy as UTF-8 with BOM

In Visual Studio Code, the general procedure is:

  1. Open the working copy.
  2. Confirm that the editor has interpreted the original text correctly.
  3. Select the encoding indicator in the editor's status bar.
  4. Choose Save with Encoding.
  5. Select UTF-8 with BOM.
  6. Save the result as a separate file for review.

When the original file contains an Authenticode signature, editing and saving the text can invalidate that signature. Do not deploy the edited copy until it has been correctly re-signed and verified.

PowerShell script opened in a code editor showing UTF-8 with BOM encoding for signature repair
Save a reviewed copy using valid UTF-8 with BOM, then apply a new authorized digital signature before deployment.

Step 4: Re-Sign the Corrected File

Use your organization's approved code-signing process. If your approved code-signing certificate is available to PowerShell and assigned to the variable $cert, the signing command follows this format:

Set-AuthenticodeSignature -FilePath "C:\Scripts\Deploy.utf8bom.ps1" -Certificate $cert

The command above assumes the file already exists and $cert contains the correct authorized signing certificate. It is not a complete certificate-enrollment or deployment procedure.

After signing, verify the result:

Get-AuthenticodeSignature -FilePath "C:\Scripts\Deploy.utf8bom.ps1" | Format-List Status, StatusMessage

Confirm that the signature reports Valid. Review the script content and test the corrected file in a controlled environment before replacing any production version.

Microsoft provides technical guidance in Encoding Guidance for Signed PowerShell Scripts.

Method 3: Use Microsoft's Repair-SignedPowerShellUtf8.ps1 Tool

Microsoft published a sample utility named Repair-SignedPowerShellUtf8.ps1, documented in KB5136213, to help administrators investigate and repair certain PowerShell script encoding problems introduced or exposed by stricter signature validation.

The tool supports three modes:

ModePurposeChanges the Original File?
ScanIdentifies potential encoding problems and reports the signature status.No
RepairAttempts a temporary repair while retaining the existing signature in a separate copy.No
ConvertToUtf8BomCreates a UTF-8-with-BOM copy for review and re-signing.No

Microsoft states that the sample utility does not overwrite the original script or an existing output file. However, a successful repair is not guaranteed, and some encoding scenarios cannot be repaired without re-signing.

Step 1: Obtain the Tool from Microsoft

Use the full script published in Microsoft's Repair-SignedPowerShellUtf8.ps1 documentation.

Save the official sample script locally and review it before use. Run it with Windows PowerShell 5.1 from the directory containing the utility, following your organization's script-execution and application-control policies.

The utility requires FullLanguage mode. If it is blocked by enterprise security controls, use the organization's approval process rather than disabling those controls.

Step 2: Run a Read-Only Encoding Scan

For a directory containing PowerShell scripts, use the following example:

.\Repair-SignedPowerShellUtf8.ps1 -Mode Scan -Path "C:\Scripts" -Recurse | Format-Table Path, Issue, SignatureStatus, Action -Wrap

For a single script, omit -Recurse and provide the full file path:

.\Repair-SignedPowerShellUtf8.ps1 -Mode Scan -Path "C:\Scripts\Deploy.ps1"
Microsoft Repair-SignedPowerShellUtf8.ps1 running read-only Scan mode to diagnose PowerShell script encoding issues
Start with Microsoft's read-only Scan mode to identify possible encoding and signature problems before making repairs.

The scan reports potential encoding issues, the current signature status, and a suggested action. It does not change the script being inspected.

Step 3: Interpret the Scan Results

Depending on the file, Microsoft documents several possible issue labels:

  • MalformedUtf8: The file may contain invalid UTF-8 data.
  • Utf8WithoutBom: A UTF-8 file without a BOM may have been interpreted using a different system encoding.
  • CodePageTextReadAsUtf8: Text saved in a legacy code page may have been interpreted as UTF-8.
  • NotValidInCodePage: The file is not valid under the selected system code page and is not valid UTF-8.
  • None: The scan did not detect a relevant encoding problem.

If the result is None, do not perform an encoding repair merely because Get-AuthenticodeSignature reports NotSigned. Investigate other causes, including unsigned or modified files and certificate-related problems.

Step 4: Attempt Repair When Supported

For certain previously signed scripts, the tool can attempt to create a new copy whose existing signature validates:

.\Repair-SignedPowerShellUtf8.ps1 -Mode Repair -Path "C:\Scripts\Deploy.ps1"

Microsoft describes this as a temporary repair option for certain malformed UTF-8 and UTF-8-without-BOM scenarios.

It does not reconstruct missing text, correct arbitrary script bugs, or create a new digital signature. Some files cannot be repaired using this mode.

Review the reported SignatureStatus for the resulting copy. Only consider deployment when the signature validates and the repaired script has been reviewed and tested.

Step 5: Convert to UTF-8 with BOM When Re-Signing Is Needed

When the appropriate long-term fix is conversion and re-signing, use:

.\Repair-SignedPowerShellUtf8.ps1 -Mode ConvertToUtf8Bom -Path "C:\Scripts\Deploy.ps1"

The tool creates a separate UTF-8-with-BOM copy. Its default naming pattern produces a filename such as Deploy.utf8bom.ps1.

The converted copy does not retain the old Authenticode signature and must be reviewed and signed again through an approved process.

For scripts originally saved in a language-specific encoding, Microsoft provides a -SourceCodePage option. Use it only when the original encoding is known. Selecting an incorrect code page may change the script text.

Do not replace the production script until the converted copy has been checked, signed, verified, and tested.

Read the complete Microsoft KB5136213 repair tool documentation for supported parameters and limitations.

Method 4: Check ExecutionPolicy and App Control Restrictions

Sometimes a PowerShell script is not working because script execution is restricted, not because of encoding or a damaged signature.

A common message is:

File cannot be loaded because running scripts is disabled on this system.

This error is associated with PowerShell execution policy settings. It should be investigated separately from the November 2026 Authenticode encoding change.

Step 1: Check Your Effective Execution Policy

Run:

Get-ExecutionPolicy -List

The output shows the policies defined at different scopes, including MachinePolicy, UserPolicy, Process, CurrentUser, and LocalMachine.

Group Policy settings take precedence over user-level preferences. If your computer is managed by an organization, contact the administrator rather than trying to override the policy.

Step 2: Review RemoteSigned for Personal Scripts

On a personally managed computer, if you understand the script's source and your execution policy is unnecessarily restrictive, RemoteSigned may be appropriate.

The command to set this preference for the current user is:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

This allows locally created scripts to run while retaining signature requirements for files identified as downloaded from the internet.

Do not use this command as a fix for an invalid Authenticode signature. An execution policy change does not repair malformed file encoding or restore a broken digital signature.

Step 3: Review Downloaded File Blocking

Windows can mark downloaded files with internet-origin information. Under certain execution policies, this can affect whether a script is permitted to run.

For a script you have obtained from a trusted source and inspected, the following command can remove the download-origin block:

Unblock-File -Path "C:\Scripts\Deploy.ps1"

Only unblock a file after verifying its origin and content. This operation does not validate the script's safety or fix its Authenticode signature.

See Microsoft Learn: About Execution Policies.

Step 4: Check ConstrainedLanguage Mode

If PowerShell reports restrictions involving ConstrainedLanguage, inspect the current session's language mode:

$ExecutionContext.SessionState.LanguageMode

On devices enforcing App Control for Business or other application control policies, PowerShell may restrict untrusted script execution.

Microsoft notes that affected scripts with invalid encoding can encounter trust-related restrictions after the November 2026 change. However, ConstrainedLanguage can also arise from normal application control enforcement.

Do not disable WDAC, AppLocker, or other application-control protections to make a script run. Confirm the script's approved publisher, encoding, signature status, and organizational policy.

For additional information, see Microsoft's PowerShell App Control documentation.

Method 5: Fix Script Paths, PATH Variables and Task Scheduler

A PowerShell script may work correctly when launched from its folder but fail when started by a scheduled task, batch file, desktop shortcut, or another application.

This often happens because the script relies on the current working directory or expects an external executable to be available through the PATH environment variable.

Check the Script's Working Directory

Open PowerShell and run:

Get-Location

This command shows the current working directory. It may differ from the directory containing the running script.

For example, a script stored in C:\Scripts might attempt to read a file using:

Import-Csv ".\data.csv"

This relative path depends on the current location. If the script is launched from another directory, PowerShell may look for data.csv in the wrong place.

Use PSScriptRoot for Files Beside Your Script

Inside a saved script, the automatic variable $PSScriptRoot identifies the directory containing the script file.

A more reliable approach is:

$dataPath = Join-Path -Path $PSScriptRoot -ChildPath "data.csv"
Import-Csv -LiteralPath $dataPath

Using the script directory reduces dependence on the working folder selected by a shortcut, batch file, or scheduler.

You can check whether the expected file exists:

Test-Path -LiteralPath "C:\Scripts\data.csv"

Check Task Scheduler Configuration

For a scheduled task running a Windows PowerShell 5.1 script, review the action configuration.

A typical example uses:

Task Scheduler FieldExample Value
Program/scriptC:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Add arguments-NoProfile -File "C:\Scripts\Deploy.ps1"
Start inC:\Scripts

The paths above are examples. Use the correct executable, script location, and authorized user account for your environment.

If the scheduled task fails but the script works interactively, investigate the task's user account, permissions, working directory, environment variables, and execution history.

Check the PATH Environment Variable

If your script runs external applications such as Python, Git, or another command-line tool, PowerShell must be able to locate those executables.

For example, to inspect whether PowerShell can find Python:

Get-Command python -ErrorAction SilentlyContinue

To inspect your session's PATH entries:

$env:Path -split ';'

If an application is installed but not found, verify its actual executable location. On production systems, prefer explicit executable paths or approved environment configuration rather than editing the system PATH indiscriminately.

Method 6: Test the Script with PowerShell 7

Windows PowerShell 5.1 and PowerShell 7 are different PowerShell editions with different runtimes and compatibility characteristics.

Windows PowerShell 5.1 uses the powershell.exe executable. PowerShell 7 uses pwsh.exe and can be installed alongside Windows PowerShell.

Testing a script in PowerShell 7 can help identify compatibility or runtime-related issues, particularly when a script depends on features, modules, or encoding behavior that differ between PowerShell versions.

Important: Installing PowerShell 7 is not a guaranteed repair for an invalid Authenticode signature after KB5132061. Correct the underlying signing or encoding issue rather than using another PowerShell edition to bypass trust requirements.

Step 1: Check the Current PowerShell Version

Run:

$PSVersionTable.PSVersion

This displays the version of PowerShell running in the current session.

Step 2: Install PowerShell 7 If Needed

On a supported personal Windows computer with Windows Package Manager available, Microsoft's documented installation command is:

winget install --id Microsoft.PowerShell --source winget

Installation behavior and the package type can vary by release. On managed devices, follow the organization's approved software deployment procedure.

Step 3: Test a Compatible Script

After installing PowerShell 7, open a new terminal and verify that the executable is available:

pwsh -NoProfile -Command '$PSVersionTable.PSVersion'

For a trusted script that meets the applicable execution and signing requirements, the execution command follows this format:

pwsh -NoProfile -File "C:\Scripts\Deploy.ps1"

Use a non-production test environment first. Confirm that required modules, external commands, and Windows-specific dependencies are supported by the PowerShell edition being tested.

A script that uses older Windows PowerShell modules, .NET Framework-specific assemblies, or Windows-only APIs may require modifications before it works correctly in PowerShell 7.

For supported installation methods, see Microsoft Learn: Install PowerShell 7 on Windows.

PowerShell Script Error Troubleshooting Checklist

Use the following checklist to select the correct repair instead of applying every method to every script.

ProblemRecommended First StepGuide Section
Signed script suddenly reports NotSigned after KB5132061Check signature and run Microsoft's encoding scanMethod 1 and Method 3
Set-AuthenticodeSignature reports UnknownErrorInspect the full error and original file encodingMethod 2
Microsoft's scan identifies malformed UTF-8Choose supported Repair or ConvertToUtf8Bom procedureMethod 3
Running scripts is disabledInspect effective execution policy and its scopeMethod 4
ConstrainedLanguage restrictions appearCheck application control policies and script trustMethod 4
Script works manually but fails in Task SchedulerReview working directory, executable and user contextMethod 5
External program or data file cannot be foundVerify PSScriptRoot, PATH and file locationMethod 5
Script depends on a different PowerShell runtimeReview version and module compatibilityMethod 6

What to Do If the Script Still Fails

If you have checked the script's signature, encoding, execution policy, paths, and PowerShell version but the problem continues, focus on the exact error message and the conditions under which the failure occurs.

Confirm the Windows Update and PowerShell Environment

  1. Press Windows + R, type winver, and record your Windows version and OS build.
  2. Open Settings > Windows Update > Update history.
  3. Confirm whether KB5132061 or another relevant November 2026 update is installed.
  4. Record the PowerShell version using $PSVersionTable.PSVersion.
  5. Record the exact error message, including any StatusMessage returned by signature verification.

For Windows 11 23H2, Windows Server, or other supported operating systems, the same security-hardening family may be delivered through a different cumulative update. Check the release notes for the update installed on your particular device.

Check Whether the Original Script Is Actually Signed

The presence of text resembling a signature block does not prove that the signature is intact or valid. Compare the file with a trusted publisher copy and verify its signature using the appropriate tools.

If you do not own the signing certificate and the original script cannot be repaired while retaining its signature, contact the publisher or administrator responsible for signing it.

Review Windows Application Control Events

On managed devices, App Control or AppLocker restrictions may affect script execution. Authorized administrators can inspect relevant Windows event logs and policy deployment information to identify why a particular file was restricted.

Do not weaken security policies or disable signature enforcement merely to make the script execute.

Test the Corrected Script Before Deployment

A corrected signature does not guarantee that the script's logic is correct. After repairing or re-signing a file, test its expected behavior, dependencies, permissions, and outputs in a controlled environment.

Keep the original file and the repair results until the new version has been validated and approved for deployment.

Frequently Asked Questions

Why did my PowerShell script stop working after KB5132061?

Microsoft's November 10, 2026 update introduced stricter encoding validation for signed PowerShell scripts. Certain files containing malformed UTF-8 or incompatible text encoding may fail signature verification. However, other script errors can have unrelated causes, so check the signature and run the official encoding scan before making changes.

How do I fix Get-AuthenticodeSignature returning NotSigned?

First verify whether the script was previously signed and whether its content changed. Run Microsoft's Repair-SignedPowerShellUtf8.ps1 utility in Scan mode to look for encoding problems. If an issue is confirmed, follow the appropriate repair or UTF-8-with-BOM conversion and re-signing process. NotSigned alone does not prove an encoding issue.

What causes PowerShell Set-AuthenticodeSignature UnknownError?

An UnknownError result can have different causes. After the November 2026 security change, certain malformed text encodings can produce a signing failure with a character-mapping message. Review the full error and the file's original encoding before converting or signing it again.

What is Repair-SignedPowerShellUtf8.ps1?

Repair-SignedPowerShellUtf8.ps1 is a Microsoft sample utility documented in KB5136213. It can scan scripts for potential encoding issues, attempt a temporary repair that retains an existing signature, or create a UTF-8-with-BOM copy for review and re-signing. It does not overwrite the original file.

Does saving a script as UTF-8 with BOM fix its signature?

Not automatically. Adding a BOM does not repair invalid UTF-8 bytes, and editing a signed file can invalidate its existing signature. Microsoft recommends reviewing the corrected text, saving it as valid UTF-8 with BOM, signing the copy again, and verifying that its signature is valid.

Should I disable PowerShell ExecutionPolicy after KB5132061?

No. Changing execution policy does not repair invalid script encoding or an Authenticode signature. If PowerShell reports that script execution is disabled, check Get-ExecutionPolicy -List and review the applicable policy. Do not bypass organizational Group Policy or application control restrictions.

Why does my PowerShell script work manually but fail in Task Scheduler?

A scheduled task may run under a different user account, working directory, executable path, or environment. Check the Task Scheduler action, script path, Start in directory, file permissions, and external program dependencies. Use PSScriptRoot for files stored beside the script when appropriate.

Will installing PowerShell 7 fix scripts broken by KB5132061?

PowerShell 7 can help troubleshoot runtime and module compatibility issues, but it is not a guaranteed fix for an invalid Authenticode signature. Windows PowerShell 5.1 and PowerShell 7 can be installed side by side. Correct script encoding and signature problems before deployment.

Can KB5132061 cause ConstrainedLanguage mode?

Microsoft documents cases in which affected scripts with malformed UTF-8 encounter ConstrainedLanguage restrictions on devices enforcing App Control for Business. However, ConstrainedLanguage mode can also result from normal application control policies. Check the script's trust status and contact the administrator rather than disabling security controls.

Final Thoughts: Fix PowerShell Script Errors Safely

If your PowerShell script stopped working after KB5132061, start by checking the script's signature and using Microsoft's read-only encoding diagnostic tool. The November 2026 security change can affect certain scripts containing malformed UTF-8 or incompatible text encodings, but not every PowerShell failure is related to that update.

For confirmed encoding problems, Microsoft provides options to attempt a temporary repair or create a UTF-8-with-BOM copy for review and re-signing. Always preserve the original script and verify the repaired copy before using it in production.

If the script has a valid signature but still fails, investigate execution policies, App Control restrictions, working directories, Task Scheduler configuration, and differences between Windows PowerShell 5.1 and PowerShell 7.

The safest troubleshooting process is to identify the actual failure before changing script content, signatures, or Windows security settings.

For additional Windows troubleshooting resources, visit ERRORCODESOLUTIONS.COM.

Daniel Mercer

Daniel Mercer

Daniel Mercer is an editorial pen name used by ErrorCodeSolutions for guides to Windows errors, browser issues, applications, and everyday PC troubleshooting. Articles under this byline focus on explaining symptoms, identifying possible causes, and presenting practical steps with clear precautions. Research-based guidance and documented hands-on testing are distinguished in the relevant article. This pen name does not represent a claimed certification or an independently verified professional biography.