Files
easystream-main/ENABLE_POWERSHELL.md
2025-10-26 02:14:52 -07:00

2.6 KiB

Enable PowerShell Script Execution

You need to enable PowerShell script execution to use the Continuous Delivery system.

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:

  1. Right-click the Start Menu or press Win+X
  2. Select "Windows PowerShell (Admin)" or "Terminal (Admin)"
  3. When UAC prompts, click Yes
  4. Run: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
  5. Type Y and press Enter
  6. Close the admin window
  7. Go back to your normal PowerShell terminal
  8. 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.