Troubleshooting Win10 Powershell: PowerShell Scripts Not Running After Update to 7

Abstract: Resolve PowerShell 7 scripts failing to run on Windows 10 by setting the CurrentUser execution policy to RemoteSigned and removing Zone.Identifier blocks.

Created: 2026-09-05 by
PowerShell scripts fail to run after updating to version 7 on Windows 10 primarily because the execution policy resets or conflicts with system security settings. This issue often stems from the new installation path not inheriting previous configurations, leaving scripts blocked by default policies. You can resolve this by explicitly setting the execution policy for the current user and verifying that your script files are not blocked by Windows Defender.

Understanding Execution Policy Changes

When you install PowerShell 7 (pwsh), it operates as a separate instance from the legacy Windows PowerShell 5.1. Unlike its predecessor, the newer version does not automatically inherit the execution policy settings configured in the registry for Windows PowerShell. By default, PowerShell 7 sets the execution policy to Restricted, which prevents any scripts from running unless they are digitally signed or you change the policy. This is a deliberate security measure to protect users who may be unaware of the risks associated with running unsigned code. To check your current execution policy, open PowerShell 7 and run the following command:
Get-ExecutionPolicy -List
This command displays the execution policy for each scope: Local Machine, Current User, and Process. If the Current User or Process scopes show Restricted, your scripts will fail to execute even if the Local Machine policy allows them. The most effective solution is to set the policy for the Current User, which requires no administrative privileges and applies only to your account.

Setting the Correct Execution Policy

To allow scripts to run, you need to change the execution policy to RemoteSigned or Unrestricted. RemoteSigned is generally recommended for most users because it allows locally created scripts to run while requiring downloaded scripts to be signed by a trusted publisher. To apply this change, use the Set-ExecutionPolicy cmdlet with the Scope parameter specified as CurrentUser.
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
You will be prompted to confirm the change; type Y and press Enter. After executing this command, try running your script again using the full path to the file. For example, if your script is located at C:\Scripts\MyScript.ps1, you would run .\C:\Scripts\MyScript.ps1. If the script runs successfully, the issue was indeed related to the execution policy. Note that this change persists across sessions but only affects your specific user profile. If you encounter permission errors when trying to set the policy, ensure that you are running PowerShell 7 as the correct user. Sometimes, residual settings from previous installations can interfere. In such cases, restarting the PowerShell session or logging out and back in can clear temporary state issues. Additionally, verify that no group policies are overriding your local settings, especially if you are on a corporate network. For more insights on handling persistent script issues, consider reviewing our guide on PowerShell Script Not Working: Remove First 9 Characters of Certain Files.

Checking File Attributes and Security Blocks

Even with the correct execution policy, scripts may still fail to run if Windows marks the file as blocked. When you download a script from the internet, Windows adds an alternate data stream called Zone.Identifier to the file, indicating its origin. PowerShell respects this attribute and blocks execution to prevent potential malware. To remove this block, right-click the script file in File Explorer, select Properties, and look for a checkbox labeled "Always ask before opening this file" or a message stating "This file came from another computer and might be blocked." Click the Unblock button next to it and apply the changes. For bulk unblocking, you can use the Unblock-File cmdlet in PowerShell. This is particularly useful if you have multiple scripts in a directory that need to be executed. Run the following command to unblock all PowerShell files in the current directory:
Get-ChildItem -Filter *.ps1 | Unblock-File
This command retrieves all files with the .ps1 extension and pipes them to Unblock-File, which removes the Zone.Identifier stream. After unblocking, attempt to run the script again. If it still fails, check the error message carefully. Common errors include missing dependencies or syntax issues introduced during the update process. Ensure that your script does not rely on modules that were removed or updated in the new PowerShell version.

Verifying Module Compatibility

After updating to PowerShell 7, some modules may become incompatible due to changes in the underlying framework. PowerShell 7 uses .NET Core, whereas Windows PowerShell 5.1 uses the full .NET Framework. Modules designed for .NET Framework may not work correctly in PowerShell 7. To identify problematic modules, check the error logs for references to missing types or assemblies. You can also list installed modules using Get-Module -ListAvailable and compare them against your requirements. If a specific module is causing issues, consider installing a compatible version or using a workaround. Some popular modules have been updated to support PowerShell 7, so check for updates via the PowerShell Gallery. Use the Update-Module cmdlet to fetch the latest versions. If no update is available, you may need to contact the module author or find an alternative solution. For troubleshooting deeper integration issues, such as those involving third-party shells, see our article on PowerShell Not Starting in ConEmu on Windows 10: A Troubleshooting Guide.

Reinstalling PowerShell 7

If none of the above steps resolve the issue, a clean reinstall of PowerShell 7 might be necessary. Corrupted installation files or conflicting registry entries can cause unexpected behavior. Before reinstalling, uninstall the current version via Settings > Apps > Installed Apps. Then, download the latest installer from the official GitHub repository. During installation, ensure that you select the option to add PowerShell to the PATH environment variable if you prefer launching it from the command line. After reinstallation, repeat the steps to set the execution policy and unblock your scripts. This fresh start often clears up lingering configuration problems. Keep in mind that custom configurations, aliases, and profiles will need to be recreated. Back up your profile files located in $PROFILE before uninstalling to preserve your settings. If you continue to experience difficulties, consider checking Windows Event Viewer for detailed error logs related to PowerShell crashes or failures.

Frequently Asked Questions

Why did my scripts stop working immediately after the update?

The update likely reset the execution policy to Restricted for PowerShell 7, which does not inherit settings from Windows PowerShell 5.1. You must manually set the policy to RemoteSigned or Unrestricted for your user account to allow script execution again.

Can I set the execution policy globally for all users?

Yes, you can use the Scope parameter set to LocalMachine with administrative privileges. However, this is generally discouraged for individual desktops due to security risks, as it allows any script to run without restriction across the entire system.

What does the Unblock-File cmdlet actually do?

Unblock-File removes the Zone.Identifier alternate data stream from files, which Windows uses to mark downloads from the internet as potentially unsafe. Removing this stream tells PowerShell that the file is safe to execute based on your current execution policy.

Will changing the execution policy affect other applications?

No, the execution policy only affects how PowerShell interprets and runs script files. It has no impact on other applications, system stability, or general Windows functionality. It is a sandboxed security feature specific to the PowerShell engine.

How do I restore my old PowerShell profile after reinstalling?

You can copy your saved $PROFILE file from the backup location to the new installation directory. The profile path remains the same ($HOME\Documents\PowerShell\Microsoft.PowerShell_profile.ps1) unless you have customized it, ensuring your aliases and functions are restored.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More