Files
PowerToys/src/settings-ui/Settings.UI/ViewModels/PowerScriptInput.cs
Muyuan Li (from Dev Box) 35ccc7658d PowerScripts: let users edit a file script's trigger extensions in Settings
Add a per-script "Trigger on file types" editor (a SettingsExpander with
an editable extensions box + Apply) on the PowerScripts page for file
scripts. Applying calls a new host command, set-extensions <id> --ext
<.md .txt ...>, which rewrites the manifest's input.extensions via the
shared serializer, then re-registers the Explorer right-click submenu
(uninstall old verbs first so a changed extension leaves nothing stale).
list --json now surfaces input.extensions so the box shows current values.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-26 16:03:42 +08:00

18 lines
576 B
C#

// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
namespace Microsoft.PowerToys.Settings.UI.ViewModels
{
/// <summary>
/// The declared file-input contract for a script. Mirrors the <c>input</c> object emitted by
/// <c>PowerScripts.Host.exe list --json</c>.
/// </summary>
public sealed class PowerScriptInput
{
public List<string> Extensions { get; set; } = new();
}
}