2.6 KiB
Enable PowerShell Script Execution
You need to enable PowerShell script execution to use the Continuous Delivery system.
Quick Fix (Recommended)
Run this one-time command in PowerShell as Administrator:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
This allows you to run local scripts while still protecting against remote scripts.
Step-by-Step:
- Right-click the Start Menu or press
Win+X - Select "Windows PowerShell (Admin)" or "Terminal (Admin)"
- When UAC prompts, click Yes
- Run:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser - Type
Yand press Enter - Close the admin window
- Go back to your normal PowerShell terminal
- Run:
.\start-cd.ps1 watch
Alternative: No Admin Required (Bypass Method)
If you can't get admin access, use the bypass method for each run:
# Instead of:
.\start-cd.ps1 watch
# Use this:
powershell -ExecutionPolicy Bypass -File .\start-cd.ps1 watch
Create a Shortcut (No Admin)
Create run-cd-watch.bat with this content:
@echo off
powershell -ExecutionPolicy Bypass -File "%~dp0start-cd.ps1" watch
pause
Then just double-click run-cd-watch.bat to start CD!
Verify It's Working
After enabling, run:
Get-ExecutionPolicy
Should show: RemoteSigned or Bypass
Then test the CD system:
.\start-cd.ps1 watch
Security Notes
What does RemoteSigned mean?
- ✅ You can run scripts you create locally
- ✅ You can run scripts from your organization
- ⚠️ Downloaded scripts must be signed by a trusted publisher
- ✅ This is the Microsoft-recommended policy for developers
Is this safe?
Yes! RemoteSigned is the recommended policy for developers. It protects you from running malicious scripts downloaded from the internet while allowing you to run your own scripts.
Troubleshooting
Still getting "UnauthorizedAccess"?
Try this sequence:
# Check current policy
Get-ExecutionPolicy -List
# Set for current user only (no admin needed)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# If that fails, use bypass method
powershell -ExecutionPolicy Bypass -File .\start-cd.ps1 watch
Group Policy is blocking?
Some corporate environments block script execution via Group Policy. If you see "cannot be changed" errors, you must use the bypass method:
powershell -ExecutionPolicy Bypass -File .\start-cd.ps1 watch
Once enabled, you're ready to use the CD system! See CD_QUICK_START.md for usage.