From 632b3948e3214938c3b9186cc78a6cadd86d7e14 Mon Sep 17 00:00:00 2001 From: Sander Declerck Date: Fri, 30 Jan 2026 13:57:39 +0100 Subject: [PATCH] Add troubleshooting steps for powershell when executionpolicy doens't allow to run code --- docs/troubleshooting.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 0cd6098..0b2845b 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -149,6 +149,37 @@ Should include `~/.safe-chain/bin` **If persists:** Re-run the installation script +### PowerShell Execution Policy Blocks Scripts (Windows) + +**Symptom:** When opening PowerShell, you see an error like: + +``` +. : File C:\Users\\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 cannot be loaded because +running scripts is disabled on this system. +CategoryInfo : SecurityError: (:) [], PSSecurityException +FullyQualifiedErrorId : UnauthorizedAccess +``` + +**Cause:** Windows PowerShell's default execution policy (`Restricted`) blocks all script execution, including safe-chain's initialization script that's sourced from your PowerShell profile. + +**Resolution:** + +1. **Set the execution policy to allow local scripts:** + + Open PowerShell as Administrator and run: + + ```powershell + Set-ExecutionPolicy -ExecutionPolicy RemoteSigned + ``` + + This allows: + - Local scripts (like safe-chain's) to run without signing + - Downloaded scripts to run only if signed by a trusted publisher + +2. **Restart PowerShell** and verify the error is resolved. + +> **Note:** `RemoteSigned` is Microsoft's recommended execution policy for client computers. It provides a good balance between security and usability. + ### Shell Aliases Persist After Uninstallation **Symptom:** safe-chain commands still active after running uninstall script