Skip to content

Latest commit

 

History

History
232 lines (175 loc) · 7.15 KB

File metadata and controls

232 lines (175 loc) · 7.15 KB

PowerShell Icon Extractor

A PowerShell-based icon extraction toolkit for enterprise application packaging and deployment. Extract icons from executables without triggering security software alerts.

License PowerShell Platform

🎯 Purpose

Designed for Systems Engineers and Application Packagers who need to extract icons from executables for:

  • PSADT (PowerShell App Deployment Toolkit) shortcut creation
  • Microsoft Intune Company Portal branding
  • SCCM/ConfigMgr application deployment
  • Documentation and asset management

✨ Features

  • Security-friendly: Uses native Windows APIs - won't trigger security software
  • No dependencies: Pure PowerShell with Win32 API calls
  • Multiple formats: Extract as .ICO or .PNG with all resolutions
  • Drag-and-drop: Simple batch file interfaces
  • Batch processing: Extract icons from multiple apps at once
  • Enterprise-ready: Works in restricted environments

🚀 Quick Start

Method 1: Drag and Drop (Easiest)

  1. Download the repository
  2. Drag an executable onto Extract-Icon-ICO.bat
  3. Find your icon in the Icons folder

Method 2: Command Line

.\Extract-Icon.ps1 -SourceExe "C:\Program Files\App\App.exe" -OutputPath "C:\Output" -SaveAsIco

Method 3: Interactive Menu

Extract-Icon-Interactive.bat

📋 Prerequisites

  • Windows 10/11 or Windows Server 2016+
  • PowerShell 5.1 or higher
  • .NET Framework 4.5+ (included in Windows)
  • No elevation required
  • No external dependencies

🔧 Installation

Option A: Clone Repository

git clone https://github.com/frytzy/PowerShell-Icon-Extractor.git
cd PowerShell-Icon-Extractor

Option B: Download ZIP

  1. Visit https://github.com/frytzy/PowerShell-Icon-Extractor
  2. Click the green "Code" button
  3. Select "Download ZIP"
  4. Extract to your tools folder

Option C: Direct Download

Download individual files as needed - all scripts are standalone.

📖 Usage

For PSADT Shortcuts

.\Extract-Icon.ps1 -SourceExe "C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe" `
                   -OutputPath "C:\Packaging\AdobeAcrobat\SupportFiles" `
                   -SaveAsIco

Then reference in your Deploy-Application.ps1:

[string]$appIcon = "$dirSupportFiles\Acrobat.ico"

New-Shortcut -Path "$envCommonDesktop\Adobe Acrobat.lnk" `
             -TargetPath "$installDir\Acrobat.exe" `
             -IconLocation $appIcon

For Intune Company Portal

.\Extract-Icon.ps1 -SourceExe "C:\Program Files\App\App.exe" `
                   -OutputPath "C:\Packaging\App\Icons" `
                   -SaveAsPng

Upload the largest PNG (300x300 minimum recommended) to Intune under Program > Logo.

Batch Processing

Edit Extract-Icon-Batch-Process.bat with your applications:

set "Apps[0]=AdobeReader|C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe"
set "Apps[1]=Chrome|C:\Program Files\Google\Chrome\Application\chrome.exe"
set "Apps[2]=7Zip|C:\Program Files\7-Zip\7zFM.exe"

Then run the batch file to extract all icons at once.

🎨 Output Formats

ICO Format

  • Contains multiple resolutions (16x16, 32x32, 48x48, 256x256)
  • Perfect for Windows shortcuts
  • Native format for desktop icons
  • Compatible with all Windows versions

PNG Format

  • Individual files per resolution
  • Ideal for web/mobile interfaces
  • Required for Intune Company Portal
  • Easy to edit and resize

🛠️ Parameters

Parameter Type Required Description
-SourceExe String Yes Path to executable file
-OutputPath String Yes Directory for extracted icons
-SaveAsIco Switch No Save as multi-resolution .ico file
-SaveAsPng Switch No Save as individual PNG files

💼 Enterprise Use Cases

Application Packaging

YourApp_v1.0_Install\
├── Files\
├── SupportFiles\
│   └── AppIcon.ico          ← Extracted with this tool
└── Deploy-Application.ps1

Intune Win32 Apps

  1. Extract PNG with largest resolution
  2. Upload to Intune console
  3. Appears in Company Portal app

SCCM/ConfigMgr

Extract icons for:

  • Application catalog
  • Software Center
  • Desktop shortcuts
  • Start Menu tiles

🚨 Troubleshooting

"Execution of scripts is disabled"

The batch files use -ExecutionPolicy Bypass, but if blocked:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

No icons extracted

  • Verify executable path is correct
  • Some apps don't have embedded icons (rare)
  • Try the installer/setup.exe instead

Low quality icons

  • The executable only has small icons
  • Check vendor website for hi-res assets
  • Extract from setup.exe instead of app.exe

Security software blocking

This toolkit was designed to avoid security flags, but if necessary:

  • Request PowerShell script exception
  • Run in isolated VM
  • Scripts use only native Windows APIs

For comprehensive troubleshooting, see TROUBLESHOOTING.md

🔒 Security

  • No network access - Completely offline
  • No registry modifications - Read-only operations
  • No elevation required - Runs as standard user
  • No external dependencies - Pure Windows APIs
  • WDAC/AppLocker compatible - Standard PowerShell
  • Audit-friendly - Transparent code, no obfuscation

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

👤 Author

Frytzy - Systems Integration Engineer

  • GitHub: @frytzy
  • Company: Super Computer Inc.
  • Specialization: Enterprise Application Packaging, Microsoft Intune, SCCM
  • Experience: 31 years IT, 21 years enterprise systems

🙏 Acknowledgments

  • Designed for enterprise packaging teams
  • Developed for Katten Muchin Rosenman LLP IT department
  • Alternative to ResourceHacker for security-conscious environments
  • Inspired by the need for audit-friendly tooling

📊 Project Status

🟢 Active - Maintained and accepting contributions

🔗 Related Resources

📞 Support


If this toolkit helped you, please consider giving it a star!