Skip to content

Instantly share code, notes, and snippets.

@potatoqualitee
potatoqualitee / Show-WPFIconExample.ps1
Last active September 26, 2022 11:03
Toolbar Icons for PowerShell WPF GUI - Updated Jan 7 to support keyboard interaction.
# THIS CODE CANNOT BE COPY/PASTED INTO THE CONSOLE. PLEASE SAVE IT AS A FILE AND EXECUTE.
# Add required assemblies
Add-Type -AssemblyName PresentationFramework, System.Drawing, System.Windows.Forms, WindowsFormsIntegration
# Setup the XAML
[xml]$script:xaml = '<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Title="Acadiana (Cajun) Flag" Height="240" Width="320" Background="Gray">
<Window.TaskbarItemInfo>