PowerToysRun Plugin Dotnet Template

February 11, 2025 · View on GitHub

This is a dotnet template for creating a PowerToys Run plugin.

How to customize

Steps

  1. Clone or fork the repo.
  2. Make your desired change (like changing indent_style and end_of_line in .editorconfig).
  3. Run dotnet new install . in src directory.

How to use

Prerequisite

  • gsudo
    Or if you're using Windows later than Windows 11 24H2, change sudo {...} in debug.ps1 to sudo powershell {...}.

Usage

  1. Clone the repo
  2. Run dotnet new install . in src directory.
  3. Create new project with dotnet new ptrun -o <projectName> -pa <author>
  4. Follow TODOs in Main.cs.

Scripts

  • debug.ps1 - move debug files to destination.
  • release.ps1 - create release on github with github cli.

How to debug

  1. Build the project.
  2. Run debug.ps1.
  3. Attach to the process PowerToys.PowerLauncher.

Demo

Check ProcessKiller.

Template structure

MyPlugin
│   MyPlugin.sln
└───MyPlugin
    │   debug.ps1
    │   .editorconfig
    │   MyPlugin.csproj
    │   Main.cs
    │   plugin.json
    │   release.ps1
    ├───Images
    │       Icon.dark.png
    │       Icon.light.png
    └───Properties
            Resources.Designer.cs
            Resources.resx

Help improve this template

If you have any suggestions or improvements, feel free to open an issue or a pull request.