The Setup.ps1 script is the primary installation tool that automates the complete setup of your PowerShell development environment.
Purpose: Install and configure all components of the PowerShell DevKit
Features:
- ✅ Component-based installation
- ✅ Intelligent failure recovery
- ✅ Timeout protection
- ✅ Detailed logging
- ✅ Skip already-installed components
- ✅ Optional component filtering
# Full installation (recommended)
.\Scripts\Setup.ps1This will:
- Check prerequisites (PowerShell 7+, winget)
- Install core tools via winget
- Install PowerShell modules
- Deploy configuration files
- Set up Yazi ecosystem
- Install optional components
- Validate installation
# Run PowerShell as Administrator, then:
.\Scripts\Setup.ps1Benefits:
- All components install successfully
- No UAC prompts during installation
- Font installation works correctly
Skip installation of optional components:
.\Scripts\Setup.ps1 -SkipOptionalSkipped components:
- gsudo
- PowerColorLS
- Scoop
- resvg
- Yazi optional dependencies
Specify the Nerd Font to install:
.\Scripts\Setup.ps1 -FontName "JetBrainsMono"Default: CascadiaCode
Available fonts:
- CascadiaCode
- JetBrainsMono
- FiraCode
- Hack
- Meslo
Windows-only opt-in setting to enable local administrative shares for local administrator accounts.
.\Scripts\Setup.ps1 -EnableAdminSharesThis sets the following registry value:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\LocalAccountTokenFilterPolicy = 1
Notes:
- Requires running PowerShell as Administrator.
- Off by default; only applied when this switch is provided.
- This component is optional and is skipped by
-SkipOptional.
View detailed failure information from previous setup runs:
.\Scripts\Setup.ps1 -ShowDetailsExample output:
╔════════════════════════════════════════════════════════════╗
║ SETUP FAILURE DETAILS ║
╚════════════════════════════════════════════════════════════╝
🔸 Yazi (winget)
Last failure: 2025-11-02 10:30:15
Operation: winget install sxyazi.yazi
Admin Rights: False
Exit Code: 1
Error: Network timeout during download
💡 Suggestion: Network issue. Check internet connection and try again
Clear stored failure logs:
.\Scripts\Setup.ps1 -ClearLogs🔹 Checking prerequisites...
✓ PowerShell 7.4.1
✓ winget available
Validates:
- PowerShell 7+ is installed
- winget is available
- Internet connectivity (implicit)
Installs via winget:
- oh-my-posh
- Yazi
- fzf
- zoxide
- Microsoft Edit
Example:
🔹 Installing oh-my-posh...
→ Checking if already installed...
→ Running winget (timeout: 60s)...
✓ oh-my-posh installed successfully
Installs CascadiaCode Nerd Font (or specified font):
🔹 Installing CascadiaCode Nerd Font...
✓ Font installed via oh-my-posh
Installs from PSGallery:
- PSFzf
- Terminal-Icons
- F7History
- posh-git
Example:
🔹 Installing PowerShell modules...
→ Installing PSFzf...
✓ PSFzf installed
→ Installing Terminal-Icons...
✓ Terminal-Icons installed
Deploys:
- PowerShell profile →
$PROFILE - Windows Terminal settings
- oh-my-posh themes
🔹 Deploying PowerShell profile...
✓ Profile deployed to: C:\Users\...\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
Installs:
- Yazi configuration (git clone)
- Yazi plugins (via
ya pkg) - Yazi themes
- Optional dependencies
🔹 Setting up Yazi configuration...
→ Cloning yazi_config repository...
✓ Yazi configuration deployed
🔹 Installing Yazi plugins...
→ Installing git plugin...
✓ git plugin installed
→ Installing githead plugin (custom fork)...
✓ githead plugin installed
If not skipped:
- gsudo
- PowerColorLS
- Scoop + resvg
- Local Admin Shares Policy (only when
-EnableAdminSharesis used)
🔹 Installing optional components...
→ Installing gsudo...
✓ gsudo installed
⊘ Scoop installation skipped (user declined)
Runs basic validation:
🔹 Validating installation...
✓ All core components installed
⚠ 2 optional components skipped
Setup.ps1 is idempotent - safe to run multiple times:
- Already-installed components are detected and skipped
- Configuration files are updated if changed
- Failed components can be retried
Example:
🔹 Installing Yazi...
→ Checking if already installed...
⊘ Yazi is already installed
All operations have timeouts to prevent hangs:
| Operation | Timeout |
|---|---|
| Package check | 15 seconds |
| Package installation | 60 seconds |
| Git clone | 30 seconds |
When timeout occurs:
→ Check timed out, proceeding with installation...
Or:
⚠ Installation timed out, skipping component
Component failures are logged but setup continues:
✗ Failed to install PowerColorLS
→ Continuing with next component...
Failures are logged to Scripts/Logs/setup-details.json
Some errors stop execution:
- PowerShell version < 7.0
- winget not available
- Invalid parameters
ERROR: PowerShell 7.0 or higher is required
Current version: 5.1
Please install PowerShell 7: https://aka.ms/powershell
# Reload PowerShell profile
. $PROFILEOr restart PowerShell.
# Run validation script
.\Scripts\Test.ps1In Windows Terminal:
- Open Settings (
Ctrl+,) - Profiles → Defaults → Appearance
- Set Font face to "CaskaydiaCove Nerd Font Mono"
.\Scripts\Setup.ps1 -ShowDetailsSet-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserUpdate Windows or install App Installer from Microsoft Store.
- Check internet connection
- Try again later
- Use
-ShowDetailsto see which components failed
Run PowerShell as Administrator.
Simply re-run Setup.ps1:
.\Scripts\Setup.ps1Already-installed components will be skipped, and it will retry failed components.
The script uses standard paths, but you can customize by editing environment variables:
# Custom profile path (before running setup)
$env:PSModulePath = "C:\CustomPath\Modules;$env:PSModulePath"To install only specific component types, modify Components.psm1 to mark others as optional, then run:
.\Scripts\Setup.ps1 -SkipOptional