PowerShell: File is not digitally signed
PowerShell's execution policy requires scripts to be digitally signed but the script has no valid signature.
Quick fix
Read the commands before running them. Anything that restarts a service, deletes data or changes permissions should be tried on a non-production system first.
# Change execution policy for current user
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Or bypass for a single script
powershell -ExecutionPolicy Bypass -File script.ps1
# Unblock downloaded script
Unblock-File -Path script.ps1
How to diagnose Shell errors
Shell errors are usually about PATH, permissions, or quoting and expansion. The quoting class is the most damaging because it fails silently: an unquoted variable containing a space becomes two arguments, and an empty one disappears entirely. Running shellcheck over any script longer than a few lines catches most of these before they run.
If the quick fix above does not resolve it, work through these steps. They apply to this whole class of error, not just to this one message, which is usually what saves the time.
- Trace execution with
bash -x script.shto see each command after expansion. This makes quoting bugs immediately visible. - Start every script with
set -euo pipefailso failures stop the script instead of cascading. - Quote every variable expansion:
"$var","${arr[@]}". This single habit prevents the majority of shell bugs. - Use
command -v footo check whether something is on PATH, andecho "$PATH"to see what the shell is actually searching. - In Makefiles, recipe lines must begin with a real tab character. "missing separator" always means spaces were used instead.
Tools worth reaching for
shellcheckbash -xset -euo pipefailcommand -vcat -A (to reveal tabs)
Authoritative references
Primary documentation for this error, worth reading before applying any fix in production.
Related Shell errors
- bash: $'\r': command not foundThe script has Windows line endings. Bash treats the carriage return as part of the last…
- bash: Argument list too longA glob expanded to more arguments than the kernel's exec limit allows. The limit is on the…
- bash: bad interpreter: No such file or directoryThe script's shebang line ends with a carriage return, so the kernel looks for an interpreter…
- bash: bad substitutionInvalid parameter expansion syntax. May be caused by using bash-specific syntax in sh, or…
- bash: command not foundThe shell cannot find the specified command. The program is not installed, not in PATH, or…
- bash: Permission deniedThe script or binary does not have execute permission, or the user lacks permission to access…
- bash: syntax error near unexpected tokenThe shell encountered a syntax error, often caused by incorrect quoting, missing escapes…
- bash: unbound variableA variable was referenced but not set, and the script uses 'set -u' (nounset) which treats…
Browse other categories
- HTTP 494xx client errors, 5xx server errors, redirects, headers and protocol problems.
- JavaScript 42npm resolution, async pitfalls, hydration, memory limits and runtime type…
- Database 41Connections, deadlocks, constraints, replication and memory limits.
- AI 35Rate limits, context windows, GPU memory and model-serving failures.
- Network 35Refused connections, timeouts, resets, MTU problems and port exhaustion.
- Python 35Imports, virtual environments, encoding, concurrency and dependency conflicts.
- Kubernetes 34CrashLoopBackOff, ImagePullBackOff, OOMKilled, RBAC, scheduling and storage.
- Docker 27Daemon connectivity, disk space, image pulls, ports and architecture mismatches.
- System 26Disk space, systemd units, file descriptors, OOM killer and scheduled jobs.
- Cloud 25IAM permissions, quotas, service limits and credential failures.
- Security 25JWT validation, CSRF, OAuth grants, SELinux, SSH host keys and CSP.
- TLS 24Untrusted authorities, expiry, hostname mismatch, chains and cipher negotiation.
Something missing or wrong?
This entry is maintained by hand. If the fix is out of date, incomplete, or you have a better one, email a correction and it will be reviewed.