mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 20:20:49 +00:00
Add troubleshooting steps for powershell when executionpolicy doens't allow to run code
This commit is contained in:
parent
1c3037a1bf
commit
162ac2caae
1 changed files with 31 additions and 0 deletions
|
|
@ -149,6 +149,37 @@ Should include `~/.safe-chain/bin`
|
||||||
|
|
||||||
**If persists:** Re-run the installation script
|
**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\<username>\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
|
### Shell Aliases Persist After Uninstallation
|
||||||
|
|
||||||
**Symptom:** safe-chain commands still active after running uninstall script
|
**Symptom:** safe-chain commands still active after running uninstall script
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue