Skip to content

About

PowerShell post-installation script to minimize and customize Windows operating systems

Resources

Stars

0 stars

Watchers

0 watching

Forks

Β 
Β 

Repository files navigation

Windows Customization Toolkit

License: BSD-3 PowerShell Windows

A comprehensive collection of PowerShell scripts designed to automate Windows post-installation customization, debloating, privacy hardening, and system optimization. This toolkit transforms a fresh Windows installation into a streamlined, privacy-focused, and performance-optimized system with minimal manual intervention.

🎯 Purpose

This repository addresses common pain points with fresh Windows installations by providing:

  • Automated debloating - Removes unwanted pre-installed applications and services
  • Privacy hardening - Disables telemetry, advertising, and data collection features
  • Performance optimization - Applies system tweaks for better responsiveness
  • Security enhancements - Configures Windows Defender, BitLocker, and security policies
  • User experience improvements - Customizes Explorer, taskbar, and system behaviors
  • Enterprise-ready configuration - Suitable for both home users and enterprise environments

⚠️ Safety First

CRITICAL: These scripts make extensive system modifications. Before running:

  1. Create a system backup or use a virtual machine for testing
  2. Review all scripts in the includes/ directory to understand changes
  3. Test on non-production systems first
  4. Run PowerShell as Administrator for proper execution
  5. Understand rollback procedures - system restore points are created but have limitations

πŸš€ Quick Start

Method 1: One-Line Installation (Recommended)

Open PowerShell as Administrator and execute:

Set-ExecutionPolicy Bypass -Scope Process -Force; `
    iwr -useb https://raw.githubusercontent.com/ShaheedFazal/customize-windows-setup/main/download-repo.ps1 | iex; `
    & "C:\Temp\customize-windows-setup\customize-windows-setup-main\customize-windows-client.ps1"

Method 1b: One-Line Installation (Microsoft Account & OneDrive Enabled)

For machines that need to keep Microsoft Account and OneDrive functionality, use this variant:

Set-ExecutionPolicy Bypass -Scope Process -Force; `
    iwr -useb https://raw.githubusercontent.com/ShaheedFazal/customize-windows-setup/main/download-repo.ps1 | iex; `
    & "C:\Temp\customize-windows-setup\customize-windows-setup-main\customize-windows-client-with-microsoft.ps1"

This variant skips the following scripts:

  • ZZ-Disable-MicrosoftAccount.ps1 - Keeps Microsoft Account sign-in enabled
  • Uninstall-OneDrive.ps1 - Keeps OneDrive installed and functional

Use this variant for:

  • Machines requiring cloud sync and backup
  • Users who rely on Microsoft 365 integration
  • Environments using OneDrive for Business
  • Systems that need Microsoft Account authentication

Method 2: Manual Installation

  1. Download and run download-repo.ps1 to extract the repository to C:\Temp
  2. Navigate to the extracted folder
  3. Execute customize-windows-client.ps1 as Administrator

πŸ—οΈ Architecture

Core Components

customize-windows-setup/
β”œβ”€β”€ customize-windows-client.ps1              # Main orchestrator script (full debloating)
β”œβ”€β”€ customize-windows-client-with-microsoft.ps1  # Variant keeping Microsoft Account & OneDrive
β”œβ”€β”€ download-repo.ps1                         # Repository downloader utility
β”œβ”€β”€ includes/                                 # Modular customization scripts
β”‚   β”œβ”€β”€ Shared-Functions.ps1                  # Common utility functions
β”‚   β”œβ”€β”€ [Feature Scripts]                     # Individual customization modules
β”‚   └── disabled/                             # Scripts excluded from execution
β”œβ”€β”€ wallpaper/                                # Custom wallpaper assets
β”œβ”€β”€ HKCU-to-HKLM-Migration.md                 # Policy migration documentation
└── AGENTS.md                                 # Development guidelines

Execution Flow

  1. Initialization: Creates system restore point, sets up logging
  2. Registry Backup: Backs up critical registry hives (HKLM, HKCR, HKU)
  3. Script Discovery: Loads all .ps1 files from includes/ (excluding disabled/)
  4. Sequential Execution: Runs scripts alphabetically, with ZZZ- prefixed scripts last
  5. Multi-User Application: Applies changes to current user, all loaded profiles, and default template
  6. Error Handling: Logs failures and continues execution where possible

πŸ”§ Features Overview

Privacy & Security

  • Telemetry Removal: Disables Windows diagnostic data collection
  • Advertising Removal: Blocks Microsoft advertising and consumer features
  • Cortana Disable: Turns off voice assistant and data collection
  • Search Hardening: Removes Bing integration from Windows Search
  • Feedback Suppression: Prevents Windows feedback prompts

Note: Location services are NOT disabled by default to preserve automatic time zone detection and time sync functionality. A disabled script exists in includes/disabled/ if needed.

System Debloating

  • App Removal: Uninstalls pre-installed Microsoft Store apps
  • Service Optimization: Disables unnecessary Windows services
  • Startup Cleanup: Removes unwanted startup programs
  • OneDrive Removal: Complete OneDrive uninstallation (optional)

Performance Optimization

  • Power Management: Sets High Performance power plan with integrated 30-minute screen lock
  • Fast Startup: Disables problematic Fast Startup feature
  • Hibernation: Disables hibernation to save disk space
  • Visual Effects: Optimizes animations and visual effects

User Experience

  • Explorer Tweaks: Shows file extensions, optimizes folder views
  • Taskbar Customization: Hides unwanted buttons and icons
  • Desktop Cleanup: Removes unnecessary desktop icons
  • Custom Wallpaper: Applies consistent wallpaper across all users

Security Enhancements

  • Automatic Screen Lock: 30-minute display timeout with password protection
  • Windows Defender: Optimizes antivirus settings
  • BitLocker: Enables drive encryption (where supported)
  • Account Security: Configures user account policies
  • Network Security: Hardens network and firewall settings
  • Wake on LAN: Configures network adapters for remote wake capability (with multi-language support)

πŸ“ Script Categories

Core System Scripts

  • Configure-Clipboard.ps1 - Clipboard history and cross-device sync
  • Disable-FastStartup.ps1 - Removes Fast Startup for stability
  • Disable-Hibernation.ps1 - Disables hibernation mode
  • Set-PowerManagement-HighPerformance.ps1 - High Performance power plan with 30-minute screen lock

Privacy Scripts

  • Disable-Cortana.ps1 - Removes voice assistant features
  • Disable-Bing-Search.ps1 - Removes web search integration
  • Strengthen-Privacy.ps1 - Comprehensive privacy hardening

User Interface Scripts

  • Hide-People-Icon-Taskbar.ps1 - Removes People icon
  • Hide-Widgets-Icon.ps1 - Removes Widgets button
  • Show-Known-File-Extensions.ps1 - Shows file extensions
  • Set-Control-Panel-View-to-Small-Icons.ps1 - Optimizes Control Panel

Application Management

  • Uninstall-Default-Software-Packages.ps1 - Removes bloatware
  • Uninstall-OneDrive.ps1 - Complete OneDrive removal

Network & Hardware Scripts

  • Enable-WakeOnLan.ps1 - Configures Wake on LAN with international language support

Finalization Scripts (ZZZ- prefix)

  • ZZZ-Set-Wallpaper.ps1 - Applies custom wallpaper system-wide

Note: Screen lock functionality is integrated into Set-PowerManagement-HighPerformance.ps1 rather than using a separate screensaver script, providing a consolidated approach to power management and security.

πŸ›‘οΈ Security Features

Registry Policy Migration

The toolkit uses HKLM (Local Machine) policies instead of HKCU (Current User) settings to ensure:

  • System-wide application across all user accounts
  • Resistance to user-level changes
  • Consistent behavior for new user accounts
  • Enterprise policy compliance

Backup & Recovery

  • Automatic Backups: Creates registry backups before modifications
  • System Restore Points: Creates restoration checkpoints
  • Error Logging: Comprehensive logging for troubleshooting
  • Rollback Documentation: Clear instructions for reversing changes

🎨 Customization

Enabling/Disabling Features

  • Move scripts to includes/disabled/ to skip execution
  • Modify customize-windows-client.ps1 variables for different configurations
  • Edit individual scripts for custom behaviors

⚠️ Important: Scripts in the disabled/ folder require careful review before enabling. These scripts may contain:

  • Outdated or untested functionality
  • Settings that conflict with active scripts
  • Enterprise-specific configurations not suitable for all environments
  • Features that have been disabled for compatibility reasons

Always test disabled scripts in a virtual machine or isolated environment before moving them to the active includes/ folder.

Adding New Features

  1. Create new .ps1 script in includes/
  2. Use Shared-Functions.ps1 utilities for consistency
  3. Follow existing naming conventions
  4. Test thoroughly before deployment

Variables Configuration

Key variables in customize-windows-client.ps1:

$DRIVELABELSYS = "OS"              # System drive label
$POWERMANAGEMENT = "High performance"  # Power plan
$OFFICESUITE = "Google"            # Default office suite preference

πŸ–₯️ Windows Server Support

The toolkit includes specific logic for Windows Server environments:

  • Detects Windows Server editions
  • Applies server-appropriate configurations
  • Excludes client-only features
  • Supports Server 2016, 2019, and newer versions

πŸ“Š Logging & Monitoring

Log Files

  • Main Log: C:\Temp\customize-windows-client-[timestamp].log
  • Registry Backups: C:\Install\registry-backup-*
  • Shared Log: C:\Temp\Customization.log (via shared functions)

Error Handling

  • Non-blocking errors allow script continuation
  • Comprehensive error reporting
  • Exit codes indicate overall success/failure
  • Detailed error messages for troubleshooting

πŸ”„ Rollback & Recovery

Automatic Rollbacks

  • System Restore Points (limited by Windows frequency settings)
  • Registry backups for manual restoration
  • Service restoration utilities

Manual Rollbacks

  1. Use Windows System Restore
  2. Import registry backups from C:\Install\
  3. Re-enable services using Windows Services console
  4. Manually adjust specific settings as documented

🏒 Enterprise Considerations

Domain Environments

  • Scripts work in both workgroup and domain environments
  • Some policies may conflict with Group Policy
  • Test in isolated environments first
  • Document any Group Policy interactions

Compliance

  • All modifications use documented Windows features
  • No third-party tools or unsigned binaries
  • BSD 3-Clause license allows commercial use
  • Audit trail through comprehensive logging

πŸ› οΈ Development Guidelines

Testing Approach

  • No automated testing framework (by design)
  • Manual testing on multiple Windows versions required
  • PowerShell version compatibility checking only
  • Virtual machine testing recommended

Code Standards

  • Use shared functions from Shared-Functions.ps1
  • Implement proper error handling
  • Include descriptive comments
  • Follow existing naming conventions

Contributing

  1. Fork the repository
  2. Create feature branches
  3. Test on multiple Windows versions
  4. Submit pull requests with detailed descriptions
  5. Follow existing code style and patterns

🎯 Use Cases

Home Users

  • Clean up manufacturer bloatware
  • Improve system performance
  • Enhance privacy protection
  • Streamline user interface

IT Professionals

  • Standardize workstation configurations
  • Automate post-imaging customization
  • Implement corporate security policies
  • Reduce manual configuration time

System Builders

  • Prepare systems for delivery
  • Apply consistent configurations
  • Remove unwanted software
  • Optimize performance settings

⚑ Performance Impact

Typical Results

  • Startup Time: 20-40% faster boot times
  • Memory Usage: 10-30% reduction in RAM utilization
  • Disk Space: 2-5GB freed from app removal
  • Network Usage: Reduced background data consumption

Measurement Tools

  • Task Manager for memory/CPU monitoring
  • Resource Monitor for detailed analysis
  • PowerShell performance counters
  • Windows Performance Analyzer (advanced)

πŸ”§ Troubleshooting

Common Issues

  1. Execution Policy Errors: Use Set-ExecutionPolicy Bypass
  2. Permission Denied: Run PowerShell as Administrator
  3. Script Not Found: Verify repository extraction path
  4. Registry Access: Ensure administrative privileges

Diagnostic Steps

  1. Check PowerShell version ($PSVersionTable)
  2. Verify administrator privileges
  3. Review log files in C:\Temp\
  4. Test individual scripts in isolation

πŸ“ˆ Version History & Updates

This toolkit is actively maintained with regular updates for:

  • New Windows versions compatibility
  • Security policy updates
  • Performance optimizations
  • Bug fixes and improvements

🀝 Community & Support

Resources

Contributing

Contributions welcome for:

  • New customization modules
  • Bug fixes and improvements
  • Documentation enhancements
  • Testing on different Windows versions

πŸ“œ Legal & Licensing

License

This project is licensed under the BSD 3-Clause License, which permits:

  • Commercial and non-commercial use
  • Modification and redistribution
  • Private use and distribution

Warranty Disclaimer

This software is provided "as is" without any warranties. Users assume all risks associated with system modifications. Always backup systems before use.

πŸŽ“ Educational Value

This toolkit serves as an excellent learning resource for:

  • PowerShell scripting techniques
  • Windows registry manipulation
  • System administration automation
  • Security policy implementation
  • Enterprise configuration management

⚠️ Important Notice: Always test these scripts in a controlled environment before deploying to production systems. The toolkit makes significant system changes that may affect system stability and functionality if not properly understood and implemented.

About

PowerShell post-installation script to minimize and customize Windows operating systems

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages