Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43f94f1b65 | ||
|
|
bfc1b8c219 | ||
|
|
4c1be876f7 | ||
|
|
fa2bc278ce | ||
|
|
1bd91115d8 | ||
|
|
d9af1c5fcb | ||
|
|
dec3efaf68 | ||
|
|
1732f9371c | ||
|
|
ee90b5b746 | ||
|
|
200645e623 | ||
|
|
52aad7d7ff | ||
|
|
279aa3a24c | ||
|
|
de3ed23687 | ||
|
|
68e62f3f22 |
No files matched your search
@@ -0,0 +1,94 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to **CommandForge** are documented here.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.2.0] — 2026-06-21
|
||||
|
||||
### Added
|
||||
- **38 new commands** across all ten categories (catalog grew from 78 to 116): installed
|
||||
updates / drivers / BIOS / programs / displays; active connections, ARP cache, routing table,
|
||||
Wi-Fi profiles and WinHTTP proxy; dark/light mode and Windows 11 taskbar-alignment and
|
||||
clock-seconds tweaks; thumbnail / font / Prefetch cleanup; the Balanced power plan, power
|
||||
requests and a Fast Startup toggle; Task Manager, Device Manager, Services and Group Policy
|
||||
result; winget source list and Microsoft Store reset; Defender status and full scan; firewall
|
||||
on/off; WSL shutdown, Windows Sandbox off and a long-paths toggle.
|
||||
- **Japanese (日本語) language.** A full Japanese translation joins English and Vietnamese,
|
||||
selectable in Settings and the View menu and switching live without a restart.
|
||||
|
||||
### Changed
|
||||
- **Version-aware command list.** Commands that only apply to a specific Windows version (such as
|
||||
the Windows 11 taskbar and clock tweaks) are now hidden automatically when they do not apply to
|
||||
your build of Windows.
|
||||
|
||||
## [1.1.1] — 2026-06-19
|
||||
|
||||
### Fixed
|
||||
- **User commands hanging on `cmd`.** A user-defined command using `cmd` (e.g.
|
||||
`ping google.com`) could stay "running" forever without responding. The process runner now
|
||||
redirects and immediately closes the child's standard input, so an interactive `cmd` receives
|
||||
EOF and exits instead of blocking. User commands that use `cmd` also get `/c` prepended
|
||||
automatically (`cmd` + `ping google.com` runs as `cmd /c ping google.com`), and the run
|
||||
confirmation shows the exact command line. PowerShell and other executables are unchanged.
|
||||
- **Recipes — duplicate steps.** A command already in a recipe can no longer be added again, so a
|
||||
recipe never runs the same command multiple times.
|
||||
- **Sidebar.** Hid the vertical scrollbar on the command-groups list (still scrollable by wheel).
|
||||
|
||||
## [1.1.0] — 2026-06-19
|
||||
|
||||
### Added
|
||||
- **Package & assembly metadata.** Product, author, company, copyright and repository information
|
||||
are embedded in the assemblies (shown in About and file properties) and in the Velopack
|
||||
installer.
|
||||
- **Execution history.** A new History screen lists finished runs (newest first) with time, status
|
||||
and duration, plus **Run again** and **Clear history**. Stored locally; no telemetry.
|
||||
- **Import / export & profiles.** Export your appearance, behavior and favorites to a `.json` file
|
||||
and import them on another machine. Save the current configuration as a named **profile**
|
||||
(e.g. "Gaming PC", "Office") and switch between them.
|
||||
- **Recipes (command chains).** Build a named sequence of vetted catalog commands and run them with
|
||||
a single aggregated confirmation, **one UAC prompt** for an all-admin chain, and **stop-on-error**
|
||||
(and stop-on-reboot-required) for safety.
|
||||
- **User-defined commands ("My commands").** Add your own commands. They are kept entirely separate
|
||||
from the vetted catalog and **always run without administrator rights**.
|
||||
- **Registry before/after & undo.** For applicable tweaks, the affected registry values are read
|
||||
before and after the run and a diff is shown in the console (read-only). History entries for
|
||||
reversible commands offer **Undo**, which runs the command's vetted revert command — no arbitrary
|
||||
registry writes.
|
||||
- **Home maintenance suggestions** (e.g. low disk space → Disk Cleanup; long uptime → restart) and
|
||||
**local natural-language search** (everyday phrases such as "clean disk" suggest a catalog
|
||||
keyword). Both are 100% local — no cloud, no LLM.
|
||||
|
||||
## [1.0.0] — 2026-06-18
|
||||
|
||||
Initial public release.
|
||||
|
||||
### Added
|
||||
- **Command catalog.** An embedded, vetted, read-only catalog of Windows commands organized by
|
||||
category, with fuzzy search and a Command Palette (Ctrl+K) and an exact command-line preview.
|
||||
- **Execution engine.** Real-time console output streamed off the UI thread, cancellation, and
|
||||
restart-required detection (exit code `3010`).
|
||||
- **Admin / UAC.** Elevated commands run through a separate `CommandForge.Elevator` broker over a
|
||||
named pipe (one UAC prompt per session); the main UI stays non-elevated.
|
||||
- **Safety.** Confirmation dialogs for Caution/Dangerous commands (type-to-confirm for Dangerous,
|
||||
which cannot be disabled), optional System Restore Point, and revert for reversible tweaks.
|
||||
- **Self-update** via Velopack (per-user, delta updates) from GitHub Releases.
|
||||
- **Localization & theming.** Full English/Vietnamese UI, light/dark/system themes, and font
|
||||
scaling.
|
||||
- **Home dashboard** with recent commands, favorites and a read-only system-status widget.
|
||||
- **Diagnostics.** Settings screen, Log Viewer (filter/export), Debug panel, a global crash handler
|
||||
and a "Report a bug" flow.
|
||||
- **Accessibility** (automation names, keyboard navigation, AA contrast) and a first-run Legal Gate
|
||||
(EULA / GPLv3 / Disclaimer / Privacy).
|
||||
- **CI/CD.** Build, test and CodeQL on every change; tag-triggered releases publish SHA-256
|
||||
checksums (and an optional VirusTotal scan). No telemetry — the only network use is checking
|
||||
GitHub for updates.
|
||||
|
||||
[Unreleased]: https://github.com/poli0981/CommandForge/compare/v1.2.0...HEAD
|
||||
[1.2.0]: https://github.com/poli0981/CommandForge/compare/v1.1.1...v1.2.0
|
||||
[1.1.1]: https://github.com/poli0981/CommandForge/compare/v1.1.0...v1.1.1
|
||||
[1.1.0]: https://github.com/poli0981/CommandForge/compare/v1.0.0...v1.1.0
|
||||
[1.0.0]: https://github.com/poli0981/CommandForge/releases/tag/v1.0.0
|
||||
@@ -78,6 +78,7 @@ Velopack update mechanism works.
|
||||
|
||||
| Topic | File |
|
||||
|---|---|
|
||||
| Release history | [CHANGELOG.md](CHANGELOG.md) |
|
||||
| Build, test, publish, release | [BUILD.md](BUILD.md) · [RELEASING.md](RELEASING.md) |
|
||||
| Update mechanism (Velopack) | [UPDATES.md](UPDATES.md) |
|
||||
| Contributing & contribution rules | [CONTRIBUTING.md](.github/CONTRIBUTING.md) |
|
||||
|
||||
@@ -17,7 +17,7 @@ public interface ISettingsService
|
||||
/// <summary>The UI color theme (default <see cref="AppTheme.System"/>).</summary>
|
||||
public AppTheme Theme { get; set; }
|
||||
|
||||
/// <summary>UI language: <c>""</c> = follow OS, otherwise a culture code such as <c>"en"</c> or <c>"vi"</c>.</summary>
|
||||
/// <summary>UI language: <c>""</c> = follow OS, otherwise a culture code such as <c>"en"</c>, <c>"vi"</c> or <c>"ja"</c>.</summary>
|
||||
public string Language { get; set; }
|
||||
|
||||
/// <summary>The overall UI font size (default <see cref="FontScale.Medium"/>).</summary>
|
||||
|
||||
@@ -28,11 +28,42 @@ public static class UserCommandFactory
|
||||
TitleKey = command.Name,
|
||||
DescriptionKey = command.Name,
|
||||
Executable = command.Executable,
|
||||
ArgsTemplate = command.Arguments,
|
||||
ArgsTemplate = NormalizeArguments(command.Executable, command.Arguments),
|
||||
ExecutionMode = ExecutionMode.Capture,
|
||||
RequiresAdmin = false, // INVARIANT — a user command must never elevate.
|
||||
DangerLevel = DangerLevel.Caution,
|
||||
Restart = RestartPolicy.No,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Normalizes arguments so a one-shot command actually runs and then exits. <c>cmd.exe</c>
|
||||
/// without <c>/c</c> (or <c>/k</c>) opens an interactive shell that blocks forever waiting on
|
||||
/// stdin, so for cmd we prepend <c>/c</c>. Other executables (e.g. powershell) are left as-is.
|
||||
/// </summary>
|
||||
public static string NormalizeArguments(string executable, string? arguments)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(executable);
|
||||
|
||||
var args = arguments ?? string.Empty;
|
||||
if (IsCmd(executable) && !HasCmdRunSwitch(args))
|
||||
{
|
||||
return args.Length == 0 ? "/c" : "/c " + args;
|
||||
}
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
private static bool IsCmd(string executable)
|
||||
=> string.Equals(Path.GetFileNameWithoutExtension(executable.Trim()), "cmd", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
private static bool HasCmdRunSwitch(string arguments)
|
||||
{
|
||||
var trimmed = arguments.TrimStart();
|
||||
return StartsWithSwitch(trimmed, "/c") || StartsWithSwitch(trimmed, "/k");
|
||||
}
|
||||
|
||||
private static bool StartsWithSwitch(string text, string flag)
|
||||
=> text.StartsWith(flag, StringComparison.OrdinalIgnoreCase)
|
||||
&& (text.Length == flag.Length || char.IsWhiteSpace(text[flag.Length]));
|
||||
}
|
||||
@@ -64,4 +64,23 @@ public sealed record CommandDefinition
|
||||
|
||||
/// <summary>Free-form search tags.</summary>
|
||||
public IReadOnlyList<string> Tags { get; init; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Inclusive lowest Windows build this command applies to (e.g. <c>22000</c> for Windows 11+).
|
||||
/// <see langword="null"/> means no lower bound.
|
||||
/// </summary>
|
||||
public int? MinOsBuild { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Inclusive highest Windows build this command applies to (e.g. <c>19045</c> for Windows 10 only).
|
||||
/// <see langword="null"/> means no upper bound.
|
||||
/// </summary>
|
||||
public int? MaxOsBuild { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether this command applies to the given OS build. Pure logic (no Win32) so the presentation
|
||||
/// layer can hide commands that do not apply to the current Windows version.
|
||||
/// </summary>
|
||||
public bool AppliesToOsBuild(int build)
|
||||
=> (MinOsBuild is null || build >= MinOsBuild) && (MaxOsBuild is null || build <= MaxOsBuild);
|
||||
}
|
||||
@@ -33,6 +33,8 @@ internal sealed record CommandDto
|
||||
public string? DocUrl { get; init; }
|
||||
public string[]? Tags { get; init; }
|
||||
public RegistryValueDto[]? AffectedRegistryValues { get; init; }
|
||||
public int? MinOsBuild { get; init; }
|
||||
public int? MaxOsBuild { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>JSON shape of a registry-value reference (for before/after comparison).</summary>
|
||||
|
||||
@@ -73,6 +73,9 @@ public static class CatalogLoader
|
||||
if (string.IsNullOrWhiteSpace(dto.DescriptionKey)) { errors.Add($"Command '{dto.Id}' is missing descriptionKey."); continue; }
|
||||
if (string.IsNullOrWhiteSpace(dto.Executable)) { errors.Add($"Command '{dto.Id}' is missing executable."); continue; }
|
||||
if (dto.Restart == RestartPolicy.FromOutputRegex && !IsValidRegex(dto.RestartRegex)) { errors.Add($"Command '{dto.Id}' has an invalid restartRegex."); continue; }
|
||||
if (dto.MinOsBuild is <= 0) { errors.Add($"Command '{dto.Id}' has a non-positive minOsBuild."); continue; }
|
||||
if (dto.MaxOsBuild is <= 0) { errors.Add($"Command '{dto.Id}' has a non-positive maxOsBuild."); continue; }
|
||||
if (dto.MinOsBuild is { } minBuild && dto.MaxOsBuild is { } maxBuild && maxBuild < minBuild) { errors.Add($"Command '{dto.Id}' has maxOsBuild ({maxBuild}) less than minOsBuild ({minBuild})."); continue; }
|
||||
|
||||
commands.Add(new CommandDefinition
|
||||
{
|
||||
@@ -100,6 +103,8 @@ public static class CatalogLoader
|
||||
.Where(r => !string.IsNullOrWhiteSpace(r.Path))
|
||||
.Select(r => new RegistryValueRef { Path = r.Path!, Name = r.Name ?? string.Empty })
|
||||
.ToList(),
|
||||
MinOsBuild = dto.MinOsBuild,
|
||||
MaxOsBuild = dto.MaxOsBuild,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -920,6 +920,7 @@
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": "tweak.win11.modernmenu",
|
||||
"minOsBuild": 22000,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["windows 11", "context menu", "classic", "registry", "tweak"]
|
||||
@@ -939,6 +940,7 @@
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": "tweak.win11.classicmenu",
|
||||
"minOsBuild": 22000,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["windows 11", "context menu", "modern", "registry", "tweak"]
|
||||
@@ -1472,7 +1474,7 @@
|
||||
"createsRestorePoint": false,
|
||||
"restart": "Always",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"revertCommandId": "dev.sandbox.off",
|
||||
"estimatedDuration": "Long",
|
||||
"docUrl": null,
|
||||
"tags": ["windows sandbox", "feature", "isolation", "developer"]
|
||||
@@ -1495,5 +1497,767 @@
|
||||
"estimatedDuration": "Long",
|
||||
"docUrl": null,
|
||||
"tags": [".net framework 3.5", "netfx3", "feature", "developer"]
|
||||
},
|
||||
{
|
||||
"id": "info.hotfixes",
|
||||
"categoryId": "system-info",
|
||||
"titleKey": "Cmd_info.hotfixes_Title",
|
||||
"descriptionKey": "Cmd_info.hotfixes_Desc",
|
||||
"icon": "Update",
|
||||
"executable": "powershell",
|
||||
"argsTemplate": "-NoProfile -Command \"Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object HotFixID,Description,InstalledOn | Format-Table -AutoSize\"",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Medium",
|
||||
"docUrl": null,
|
||||
"tags": ["updates", "hotfix", "patches", "history"]
|
||||
},
|
||||
{
|
||||
"id": "info.drivers",
|
||||
"categoryId": "system-info",
|
||||
"titleKey": "Cmd_info.drivers_Title",
|
||||
"descriptionKey": "Cmd_info.drivers_Desc",
|
||||
"icon": "Chip",
|
||||
"executable": "powershell",
|
||||
"argsTemplate": "-NoProfile -Command \"Get-CimInstance Win32_PnPSignedDriver | Select-Object DeviceName,DriverVersion,DriverProviderName | Sort-Object DeviceName | Format-Table -AutoSize\"",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Medium",
|
||||
"docUrl": null,
|
||||
"tags": ["drivers", "devices", "hardware", "info"]
|
||||
},
|
||||
{
|
||||
"id": "info.bios",
|
||||
"categoryId": "system-info",
|
||||
"titleKey": "Cmd_info.bios_Title",
|
||||
"descriptionKey": "Cmd_info.bios_Desc",
|
||||
"icon": "Chip",
|
||||
"executable": "powershell",
|
||||
"argsTemplate": "-NoProfile -Command \"Get-CimInstance Win32_BIOS | Format-List Manufacturer,Name,SMBIOSBIOSVersion,SerialNumber,ReleaseDate\"",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["bios", "firmware", "uefi", "hardware"]
|
||||
},
|
||||
{
|
||||
"id": "info.env",
|
||||
"categoryId": "system-info",
|
||||
"titleKey": "Cmd_info.env_Title",
|
||||
"descriptionKey": "Cmd_info.env_Desc",
|
||||
"icon": "ClipboardListOutline",
|
||||
"executable": "powershell",
|
||||
"argsTemplate": "-NoProfile -Command \"Get-ChildItem Env: | Sort-Object Name | Format-Table -AutoSize Name,Value\"",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["environment", "variables", "path", "info"]
|
||||
},
|
||||
{
|
||||
"id": "info.installedapps",
|
||||
"categoryId": "system-info",
|
||||
"titleKey": "Cmd_info.installedapps_Title",
|
||||
"descriptionKey": "Cmd_info.installedapps_Desc",
|
||||
"icon": "PackageVariant",
|
||||
"executable": "powershell",
|
||||
"argsTemplate": "-NoProfile -Command \"Get-ItemProperty 'HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*','HKLM:\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*' | Where-Object DisplayName | Select-Object DisplayName,DisplayVersion,Publisher | Sort-Object DisplayName | Format-Table -AutoSize\"",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Medium",
|
||||
"docUrl": null,
|
||||
"tags": ["installed", "apps", "programs", "uninstall"]
|
||||
},
|
||||
{
|
||||
"id": "info.monitors",
|
||||
"categoryId": "system-info",
|
||||
"titleKey": "Cmd_info.monitors_Title",
|
||||
"descriptionKey": "Cmd_info.monitors_Desc",
|
||||
"icon": "Monitor",
|
||||
"executable": "powershell",
|
||||
"argsTemplate": "-NoProfile -Command \"Get-CimInstance Win32_VideoController | Select-Object Name,CurrentHorizontalResolution,CurrentVerticalResolution,CurrentRefreshRate | Format-List\"",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["monitor", "display", "resolution", "refresh rate"]
|
||||
},
|
||||
{
|
||||
"id": "net.netstat",
|
||||
"categoryId": "network",
|
||||
"titleKey": "Cmd_net.netstat_Title",
|
||||
"descriptionKey": "Cmd_net.netstat_Desc",
|
||||
"icon": "Lan",
|
||||
"executable": "netstat",
|
||||
"argsTemplate": "-ano",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["network", "connections", "ports", "netstat"]
|
||||
},
|
||||
{
|
||||
"id": "net.arp",
|
||||
"categoryId": "network",
|
||||
"titleKey": "Cmd_net.arp_Title",
|
||||
"descriptionKey": "Cmd_net.arp_Desc",
|
||||
"icon": "Ethernet",
|
||||
"executable": "arp",
|
||||
"argsTemplate": "-a",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["network", "arp", "cache", "mac"]
|
||||
},
|
||||
{
|
||||
"id": "net.route",
|
||||
"categoryId": "network",
|
||||
"titleKey": "Cmd_net.route_Title",
|
||||
"descriptionKey": "Cmd_net.route_Desc",
|
||||
"icon": "Lan",
|
||||
"executable": "route",
|
||||
"argsTemplate": "print",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["network", "route", "routing", "table"]
|
||||
},
|
||||
{
|
||||
"id": "net.wifi.profiles",
|
||||
"categoryId": "network",
|
||||
"titleKey": "Cmd_net.wifi.profiles_Title",
|
||||
"descriptionKey": "Cmd_net.wifi.profiles_Desc",
|
||||
"icon": "Wifi",
|
||||
"executable": "netsh",
|
||||
"argsTemplate": "wlan show profiles",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["network", "wifi", "wlan", "profiles"]
|
||||
},
|
||||
{
|
||||
"id": "net.proxy.show",
|
||||
"categoryId": "network",
|
||||
"titleKey": "Cmd_net.proxy.show_Title",
|
||||
"descriptionKey": "Cmd_net.proxy.show_Desc",
|
||||
"icon": "Ip",
|
||||
"executable": "netsh",
|
||||
"argsTemplate": "winhttp show proxy",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["network", "proxy", "winhttp"]
|
||||
},
|
||||
{
|
||||
"id": "tweak.darkmode.on",
|
||||
"categoryId": "tweaks-shortcuts",
|
||||
"titleKey": "Cmd_tweak.darkmode.on_Title",
|
||||
"descriptionKey": "Cmd_tweak.darkmode.on_Desc",
|
||||
"icon": "Brightness4",
|
||||
"executable": "powershell",
|
||||
"argsTemplate": "-NoProfile -Command \"$p='HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize'; Set-ItemProperty -Path $p -Name AppsUseLightTheme -Value 0 -Type DWord; Set-ItemProperty -Path $p -Name SystemUsesLightTheme -Value 0 -Type DWord; Write-Output 'Dark mode enabled.'\"",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": "tweak.darkmode.off",
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["dark mode", "theme", "appearance", "registry", "tweak"],
|
||||
"affectedRegistryValues": [
|
||||
{ "path": "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", "name": "AppsUseLightTheme" },
|
||||
{ "path": "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", "name": "SystemUsesLightTheme" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "tweak.darkmode.off",
|
||||
"categoryId": "tweaks-shortcuts",
|
||||
"titleKey": "Cmd_tweak.darkmode.off_Title",
|
||||
"descriptionKey": "Cmd_tweak.darkmode.off_Desc",
|
||||
"icon": "Brightness7",
|
||||
"executable": "powershell",
|
||||
"argsTemplate": "-NoProfile -Command \"$p='HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize'; Set-ItemProperty -Path $p -Name AppsUseLightTheme -Value 1 -Type DWord; Set-ItemProperty -Path $p -Name SystemUsesLightTheme -Value 1 -Type DWord; Write-Output 'Light mode enabled.'\"",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": "tweak.darkmode.on",
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["light mode", "theme", "appearance", "registry", "tweak"],
|
||||
"affectedRegistryValues": [
|
||||
{ "path": "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", "name": "AppsUseLightTheme" },
|
||||
{ "path": "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", "name": "SystemUsesLightTheme" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "tweak.win11.taskbarleft",
|
||||
"categoryId": "tweaks-shortcuts",
|
||||
"titleKey": "Cmd_tweak.win11.taskbarleft_Title",
|
||||
"descriptionKey": "Cmd_tweak.win11.taskbarleft_Desc",
|
||||
"icon": "FileCog",
|
||||
"executable": "powershell",
|
||||
"argsTemplate": "-NoProfile -Command \"Set-ItemProperty -Path 'HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name TaskbarAl -Value 0 -Type DWord; Stop-Process -Name explorer -Force -ErrorAction SilentlyContinue; Start-Sleep -Seconds 1; if (-not (Get-Process -Name explorer -ErrorAction SilentlyContinue)) { Start-Process explorer }; Write-Output 'Taskbar aligned to the left.'\"",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Caution",
|
||||
"confirmBeforeRun": true,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": "tweak.win11.taskbarcenter",
|
||||
"minOsBuild": 22000,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["windows 11", "taskbar", "align", "left", "registry", "tweak"],
|
||||
"affectedRegistryValues": [
|
||||
{ "path": "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", "name": "TaskbarAl" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "tweak.win11.taskbarcenter",
|
||||
"categoryId": "tweaks-shortcuts",
|
||||
"titleKey": "Cmd_tweak.win11.taskbarcenter_Title",
|
||||
"descriptionKey": "Cmd_tweak.win11.taskbarcenter_Desc",
|
||||
"icon": "FileCog",
|
||||
"executable": "powershell",
|
||||
"argsTemplate": "-NoProfile -Command \"Set-ItemProperty -Path 'HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name TaskbarAl -Value 1 -Type DWord; Stop-Process -Name explorer -Force -ErrorAction SilentlyContinue; Start-Sleep -Seconds 1; if (-not (Get-Process -Name explorer -ErrorAction SilentlyContinue)) { Start-Process explorer }; Write-Output 'Taskbar aligned to the center.'\"",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Caution",
|
||||
"confirmBeforeRun": true,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": "tweak.win11.taskbarleft",
|
||||
"minOsBuild": 22000,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["windows 11", "taskbar", "align", "center", "registry", "tweak"],
|
||||
"affectedRegistryValues": [
|
||||
{ "path": "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", "name": "TaskbarAl" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "tweak.clockseconds.on",
|
||||
"categoryId": "tweaks-shortcuts",
|
||||
"titleKey": "Cmd_tweak.clockseconds.on_Title",
|
||||
"descriptionKey": "Cmd_tweak.clockseconds.on_Desc",
|
||||
"icon": "ClockOutline",
|
||||
"executable": "powershell",
|
||||
"argsTemplate": "-NoProfile -Command \"Set-ItemProperty -Path 'HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name ShowSecondsInSystemClock -Value 1 -Type DWord; Stop-Process -Name explorer -Force -ErrorAction SilentlyContinue; Start-Sleep -Seconds 1; if (-not (Get-Process -Name explorer -ErrorAction SilentlyContinue)) { Start-Process explorer }; Write-Output 'Seconds shown in the system clock.'\"",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Caution",
|
||||
"confirmBeforeRun": true,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": "tweak.clockseconds.off",
|
||||
"minOsBuild": 22621,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["windows 11", "clock", "seconds", "taskbar", "registry", "tweak"],
|
||||
"affectedRegistryValues": [
|
||||
{ "path": "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", "name": "ShowSecondsInSystemClock" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "tweak.clockseconds.off",
|
||||
"categoryId": "tweaks-shortcuts",
|
||||
"titleKey": "Cmd_tweak.clockseconds.off_Title",
|
||||
"descriptionKey": "Cmd_tweak.clockseconds.off_Desc",
|
||||
"icon": "ClockOutline",
|
||||
"executable": "powershell",
|
||||
"argsTemplate": "-NoProfile -Command \"Set-ItemProperty -Path 'HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name ShowSecondsInSystemClock -Value 0 -Type DWord; Stop-Process -Name explorer -Force -ErrorAction SilentlyContinue; Start-Sleep -Seconds 1; if (-not (Get-Process -Name explorer -ErrorAction SilentlyContinue)) { Start-Process explorer }; Write-Output 'Seconds hidden from the system clock.'\"",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Caution",
|
||||
"confirmBeforeRun": true,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": "tweak.clockseconds.on",
|
||||
"minOsBuild": 22621,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["windows 11", "clock", "seconds", "taskbar", "registry", "tweak"],
|
||||
"affectedRegistryValues": [
|
||||
{ "path": "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", "name": "ShowSecondsInSystemClock" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "clean.thumbnailcache",
|
||||
"categoryId": "cleanup",
|
||||
"titleKey": "Cmd_clean.thumbnailcache_Title",
|
||||
"descriptionKey": "Cmd_clean.thumbnailcache_Desc",
|
||||
"icon": "Broom",
|
||||
"executable": "powershell",
|
||||
"argsTemplate": "-NoProfile -Command \"Stop-Process -Name explorer -Force -ErrorAction SilentlyContinue; Remove-Item -Path (Join-Path $env:LocalAppData 'Microsoft\\Windows\\Explorer\\thumbcache_*.db') -Force -ErrorAction SilentlyContinue; Start-Process explorer; Write-Output 'Thumbnail cache cleared.'\"",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Caution",
|
||||
"confirmBeforeRun": true,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["cleanup", "thumbnail", "cache", "explorer"]
|
||||
},
|
||||
{
|
||||
"id": "clean.fontcache",
|
||||
"categoryId": "cleanup",
|
||||
"titleKey": "Cmd_clean.fontcache_Title",
|
||||
"descriptionKey": "Cmd_clean.fontcache_Desc",
|
||||
"icon": "Broom",
|
||||
"executable": "powershell",
|
||||
"argsTemplate": "-NoProfile -Command \"Stop-Service -Name FontCache -Force -ErrorAction SilentlyContinue; Remove-Item -Path (Join-Path $env:SystemRoot 'ServiceProfiles\\LocalService\\AppData\\Local\\FontCache\\*') -Recurse -Force -ErrorAction SilentlyContinue; Start-Service -Name FontCache -ErrorAction SilentlyContinue; Write-Output 'Font cache cleared.'\"",
|
||||
"requiresAdmin": true,
|
||||
"dangerLevel": "Caution",
|
||||
"confirmBeforeRun": true,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Medium",
|
||||
"docUrl": null,
|
||||
"tags": ["cleanup", "font", "cache", "service"]
|
||||
},
|
||||
{
|
||||
"id": "clean.prefetch",
|
||||
"categoryId": "cleanup",
|
||||
"titleKey": "Cmd_clean.prefetch_Title",
|
||||
"descriptionKey": "Cmd_clean.prefetch_Desc",
|
||||
"icon": "Broom",
|
||||
"executable": "powershell",
|
||||
"argsTemplate": "-NoProfile -Command \"Remove-Item -Path (Join-Path $env:SystemRoot 'Prefetch\\*') -Recurse -Force -ErrorAction SilentlyContinue; Write-Output 'Prefetch folder cleared.'\"",
|
||||
"requiresAdmin": true,
|
||||
"dangerLevel": "Caution",
|
||||
"confirmBeforeRun": true,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["cleanup", "prefetch", "boot", "cache"]
|
||||
},
|
||||
{
|
||||
"id": "power.set.balanced",
|
||||
"categoryId": "power",
|
||||
"titleKey": "Cmd_power.set.balanced_Title",
|
||||
"descriptionKey": "Cmd_power.set.balanced_Desc",
|
||||
"icon": "PowerPlug",
|
||||
"executable": "powercfg",
|
||||
"argsTemplate": "/setactive 381b4222-f694-41f0-9685-ff5bb260df2e",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Caution",
|
||||
"confirmBeforeRun": true,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["power", "balanced", "plan", "scheme"]
|
||||
},
|
||||
{
|
||||
"id": "power.requests",
|
||||
"categoryId": "power",
|
||||
"titleKey": "Cmd_power.requests_Title",
|
||||
"descriptionKey": "Cmd_power.requests_Desc",
|
||||
"icon": "Power",
|
||||
"executable": "powercfg",
|
||||
"argsTemplate": "/requests",
|
||||
"requiresAdmin": true,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["power", "requests", "sleep", "awake"]
|
||||
},
|
||||
{
|
||||
"id": "power.fastboot.off",
|
||||
"categoryId": "power",
|
||||
"titleKey": "Cmd_power.fastboot.off_Title",
|
||||
"descriptionKey": "Cmd_power.fastboot.off_Desc",
|
||||
"icon": "Power",
|
||||
"executable": "reg",
|
||||
"argsTemplate": "add \"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power\" /v HiberbootEnabled /t REG_DWORD /d 0 /f",
|
||||
"requiresAdmin": true,
|
||||
"dangerLevel": "Caution",
|
||||
"confirmBeforeRun": true,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": "power.fastboot.on",
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["power", "fast startup", "hiberboot", "registry"],
|
||||
"affectedRegistryValues": [
|
||||
{ "path": "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power", "name": "HiberbootEnabled" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "power.fastboot.on",
|
||||
"categoryId": "power",
|
||||
"titleKey": "Cmd_power.fastboot.on_Title",
|
||||
"descriptionKey": "Cmd_power.fastboot.on_Desc",
|
||||
"icon": "Power",
|
||||
"executable": "reg",
|
||||
"argsTemplate": "add \"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power\" /v HiberbootEnabled /t REG_DWORD /d 1 /f",
|
||||
"requiresAdmin": true,
|
||||
"dangerLevel": "Caution",
|
||||
"confirmBeforeRun": true,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": "power.fastboot.off",
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["power", "fast startup", "hiberboot", "registry"],
|
||||
"affectedRegistryValues": [
|
||||
{ "path": "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power", "name": "HiberbootEnabled" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "diag.taskmgr",
|
||||
"executionMode": "Launch",
|
||||
"categoryId": "diagnostics",
|
||||
"titleKey": "Cmd_diag.taskmgr_Title",
|
||||
"descriptionKey": "Cmd_diag.taskmgr_Desc",
|
||||
"icon": "ChartBar",
|
||||
"executable": "taskmgr",
|
||||
"argsTemplate": "",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["task manager", "processes", "performance", "diagnostics"]
|
||||
},
|
||||
{
|
||||
"id": "diag.devmgmt",
|
||||
"executionMode": "Launch",
|
||||
"categoryId": "diagnostics",
|
||||
"titleKey": "Cmd_diag.devmgmt_Title",
|
||||
"descriptionKey": "Cmd_diag.devmgmt_Desc",
|
||||
"icon": "Chip",
|
||||
"executable": "devmgmt.msc",
|
||||
"argsTemplate": "",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["device manager", "drivers", "hardware", "diagnostics"]
|
||||
},
|
||||
{
|
||||
"id": "diag.services",
|
||||
"executionMode": "Launch",
|
||||
"categoryId": "diagnostics",
|
||||
"titleKey": "Cmd_diag.services_Title",
|
||||
"descriptionKey": "Cmd_diag.services_Desc",
|
||||
"icon": "FormatListChecks",
|
||||
"executable": "services.msc",
|
||||
"argsTemplate": "",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["services", "management", "diagnostics"]
|
||||
},
|
||||
{
|
||||
"id": "diag.gpresult",
|
||||
"categoryId": "diagnostics",
|
||||
"titleKey": "Cmd_diag.gpresult_Title",
|
||||
"descriptionKey": "Cmd_diag.gpresult_Desc",
|
||||
"icon": "ClipboardListOutline",
|
||||
"executable": "gpresult",
|
||||
"argsTemplate": "/r",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Medium",
|
||||
"docUrl": null,
|
||||
"tags": ["group policy", "gpresult", "rsop", "diagnostics"]
|
||||
},
|
||||
{
|
||||
"id": "winget.source.list",
|
||||
"categoryId": "updates-packages",
|
||||
"titleKey": "Cmd_winget.source.list_Title",
|
||||
"descriptionKey": "Cmd_winget.source.list_Desc",
|
||||
"icon": "PackageVariant",
|
||||
"executable": "winget",
|
||||
"argsTemplate": "source list",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["winget", "source", "list", "repositories"]
|
||||
},
|
||||
{
|
||||
"id": "store.reset",
|
||||
"executionMode": "Launch",
|
||||
"categoryId": "updates-packages",
|
||||
"titleKey": "Cmd_store.reset_Title",
|
||||
"descriptionKey": "Cmd_store.reset_Desc",
|
||||
"icon": "PackageVariant",
|
||||
"executable": "wsreset.exe",
|
||||
"argsTemplate": "",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Caution",
|
||||
"confirmBeforeRun": true,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Medium",
|
||||
"docUrl": null,
|
||||
"tags": ["microsoft store", "reset", "cache", "wsreset"]
|
||||
},
|
||||
{
|
||||
"id": "sec.defender.status",
|
||||
"categoryId": "security-privacy",
|
||||
"titleKey": "Cmd_sec.defender.status_Title",
|
||||
"descriptionKey": "Cmd_sec.defender.status_Desc",
|
||||
"icon": "ShieldCheck",
|
||||
"executable": "powershell",
|
||||
"argsTemplate": "-NoProfile -Command \"Get-MpComputerStatus | Format-List AMServiceEnabled,AntivirusEnabled,RealTimeProtectionEnabled,AntivirusSignatureVersion,QuickScanAge\"",
|
||||
"requiresAdmin": true,
|
||||
"dangerLevel": "Safe",
|
||||
"confirmBeforeRun": false,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["defender", "antivirus", "status", "security"]
|
||||
},
|
||||
{
|
||||
"id": "sec.defender.fullscan",
|
||||
"categoryId": "security-privacy",
|
||||
"titleKey": "Cmd_sec.defender.fullscan_Title",
|
||||
"descriptionKey": "Cmd_sec.defender.fullscan_Desc",
|
||||
"icon": "ShieldSearch",
|
||||
"executable": "powershell",
|
||||
"argsTemplate": "-NoProfile -Command \"Start-MpScan -ScanType FullScan\"",
|
||||
"requiresAdmin": true,
|
||||
"dangerLevel": "Caution",
|
||||
"confirmBeforeRun": true,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Long",
|
||||
"docUrl": null,
|
||||
"tags": ["defender", "antivirus", "full scan", "security"]
|
||||
},
|
||||
{
|
||||
"id": "sec.firewall.on",
|
||||
"categoryId": "security-privacy",
|
||||
"titleKey": "Cmd_sec.firewall.on_Title",
|
||||
"descriptionKey": "Cmd_sec.firewall.on_Desc",
|
||||
"icon": "ShieldCheck",
|
||||
"executable": "netsh",
|
||||
"argsTemplate": "advfirewall set allprofiles state on",
|
||||
"requiresAdmin": true,
|
||||
"dangerLevel": "Caution",
|
||||
"confirmBeforeRun": true,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": "sec.firewall.off",
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["firewall", "security", "enable", "network"]
|
||||
},
|
||||
{
|
||||
"id": "sec.firewall.off",
|
||||
"categoryId": "security-privacy",
|
||||
"titleKey": "Cmd_sec.firewall.off_Title",
|
||||
"descriptionKey": "Cmd_sec.firewall.off_Desc",
|
||||
"icon": "ShieldOff",
|
||||
"executable": "netsh",
|
||||
"argsTemplate": "advfirewall set allprofiles state off",
|
||||
"requiresAdmin": true,
|
||||
"dangerLevel": "Dangerous",
|
||||
"confirmBeforeRun": true,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": "sec.firewall.on",
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["firewall", "security", "disable", "network"]
|
||||
},
|
||||
{
|
||||
"id": "dev.wsl.shutdown",
|
||||
"categoryId": "developer",
|
||||
"titleKey": "Cmd_dev.wsl.shutdown_Title",
|
||||
"descriptionKey": "Cmd_dev.wsl.shutdown_Desc",
|
||||
"icon": "Console",
|
||||
"executable": "wsl",
|
||||
"argsTemplate": "--shutdown",
|
||||
"requiresAdmin": false,
|
||||
"dangerLevel": "Caution",
|
||||
"confirmBeforeRun": true,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": null,
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["wsl", "linux", "shutdown", "developer"]
|
||||
},
|
||||
{
|
||||
"id": "dev.sandbox.off",
|
||||
"categoryId": "developer",
|
||||
"titleKey": "Cmd_dev.sandbox.off_Title",
|
||||
"descriptionKey": "Cmd_dev.sandbox.off_Desc",
|
||||
"icon": "ShieldCheck",
|
||||
"executable": "dism",
|
||||
"argsTemplate": "/Online /Disable-Feature /FeatureName:Containers-DisposableClientVM",
|
||||
"requiresAdmin": true,
|
||||
"dangerLevel": "Caution",
|
||||
"confirmBeforeRun": true,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "Always",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": "dev.sandbox.on",
|
||||
"estimatedDuration": "Long",
|
||||
"docUrl": null,
|
||||
"tags": ["windows sandbox", "feature", "disable", "developer"]
|
||||
},
|
||||
{
|
||||
"id": "dev.longpaths.on",
|
||||
"categoryId": "developer",
|
||||
"titleKey": "Cmd_dev.longpaths.on_Title",
|
||||
"descriptionKey": "Cmd_dev.longpaths.on_Desc",
|
||||
"icon": "FileCog",
|
||||
"executable": "reg",
|
||||
"argsTemplate": "add \"HKLM\\SYSTEM\\CurrentControlSet\\Control\\FileSystem\" /v LongPathsEnabled /t REG_DWORD /d 1 /f",
|
||||
"requiresAdmin": true,
|
||||
"dangerLevel": "Caution",
|
||||
"confirmBeforeRun": true,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": "dev.longpaths.off",
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["long paths", "filesystem", "max_path", "registry", "developer"],
|
||||
"affectedRegistryValues": [
|
||||
{ "path": "HKLM\\SYSTEM\\CurrentControlSet\\Control\\FileSystem", "name": "LongPathsEnabled" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "dev.longpaths.off",
|
||||
"categoryId": "developer",
|
||||
"titleKey": "Cmd_dev.longpaths.off_Title",
|
||||
"descriptionKey": "Cmd_dev.longpaths.off_Desc",
|
||||
"icon": "FileCog",
|
||||
"executable": "reg",
|
||||
"argsTemplate": "add \"HKLM\\SYSTEM\\CurrentControlSet\\Control\\FileSystem\" /v LongPathsEnabled /t REG_DWORD /d 0 /f",
|
||||
"requiresAdmin": true,
|
||||
"dangerLevel": "Caution",
|
||||
"confirmBeforeRun": true,
|
||||
"createsRestorePoint": false,
|
||||
"restart": "No",
|
||||
"restartRegex": null,
|
||||
"revertCommandId": "dev.longpaths.on",
|
||||
"estimatedDuration": "Short",
|
||||
"docUrl": null,
|
||||
"tags": ["long paths", "filesystem", "max_path", "registry", "developer"],
|
||||
"affectedRegistryValues": [
|
||||
{ "path": "HKLM\\SYSTEM\\CurrentControlSet\\Control\\FileSystem", "name": "LongPathsEnabled" }
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -25,6 +25,9 @@ internal sealed class SystemProcessRunner : IProcessRunner
|
||||
Arguments = arguments,
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardError = true,
|
||||
// Redirect stdin so we can close it immediately: a process that reads input (e.g. an
|
||||
// interactive "cmd" with no /c) gets EOF and exits instead of hanging forever.
|
||||
RedirectStandardInput = true,
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true,
|
||||
// Pin the working directory to System32 so the CreateProcess search order can't
|
||||
@@ -52,6 +55,11 @@ internal sealed class SystemProcessRunner : IProcessRunner
|
||||
try
|
||||
{
|
||||
process.Start();
|
||||
|
||||
// Signal EOF on the child's stdin right away — nothing here ever feeds it input, and
|
||||
// leaving it open lets an interactive process block indefinitely.
|
||||
process.StandardInput.Close();
|
||||
|
||||
process.BeginOutputReadLine();
|
||||
process.BeginErrorReadLine();
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1337,4 +1337,232 @@ Continue?</value>
|
||||
<data name="PortableInfo_LogFolder" xml:space="preserve">
|
||||
<value>Log folder</value>
|
||||
</data>
|
||||
<data name="Cmd_info.hotfixes_Title" xml:space="preserve">
|
||||
<value>Installed Updates</value>
|
||||
</data>
|
||||
<data name="Cmd_info.hotfixes_Desc" xml:space="preserve">
|
||||
<value>List installed Windows updates and hotfixes, newest first.</value>
|
||||
</data>
|
||||
<data name="Cmd_info.drivers_Title" xml:space="preserve">
|
||||
<value>Installed Drivers</value>
|
||||
</data>
|
||||
<data name="Cmd_info.drivers_Desc" xml:space="preserve">
|
||||
<value>List signed device drivers with their versions and providers.</value>
|
||||
</data>
|
||||
<data name="Cmd_info.bios_Title" xml:space="preserve">
|
||||
<value>BIOS / Firmware Info</value>
|
||||
</data>
|
||||
<data name="Cmd_info.bios_Desc" xml:space="preserve">
|
||||
<value>Show BIOS manufacturer, version, serial number and release date.</value>
|
||||
</data>
|
||||
<data name="Cmd_info.env_Title" xml:space="preserve">
|
||||
<value>Environment Variables</value>
|
||||
</data>
|
||||
<data name="Cmd_info.env_Desc" xml:space="preserve">
|
||||
<value>List the current environment variables and their values.</value>
|
||||
</data>
|
||||
<data name="Cmd_info.installedapps_Title" xml:space="preserve">
|
||||
<value>Installed Programs</value>
|
||||
</data>
|
||||
<data name="Cmd_info.installedapps_Desc" xml:space="preserve">
|
||||
<value>List installed programs from the registry uninstall keys.</value>
|
||||
</data>
|
||||
<data name="Cmd_info.monitors_Title" xml:space="preserve">
|
||||
<value>Display Info</value>
|
||||
</data>
|
||||
<data name="Cmd_info.monitors_Desc" xml:space="preserve">
|
||||
<value>Show connected displays with current resolution and refresh rate.</value>
|
||||
</data>
|
||||
<data name="Cmd_net.netstat_Title" xml:space="preserve">
|
||||
<value>Active Connections</value>
|
||||
</data>
|
||||
<data name="Cmd_net.netstat_Desc" xml:space="preserve">
|
||||
<value>Show active TCP/UDP connections and listening ports with their PIDs.</value>
|
||||
</data>
|
||||
<data name="Cmd_net.arp_Title" xml:space="preserve">
|
||||
<value>ARP Cache</value>
|
||||
</data>
|
||||
<data name="Cmd_net.arp_Desc" xml:space="preserve">
|
||||
<value>Display the ARP table mapping IP addresses to MAC addresses.</value>
|
||||
</data>
|
||||
<data name="Cmd_net.route_Title" xml:space="preserve">
|
||||
<value>Routing Table</value>
|
||||
</data>
|
||||
<data name="Cmd_net.route_Desc" xml:space="preserve">
|
||||
<value>Print the IPv4/IPv6 routing table.</value>
|
||||
</data>
|
||||
<data name="Cmd_net.wifi.profiles_Title" xml:space="preserve">
|
||||
<value>Wi-Fi Profiles</value>
|
||||
</data>
|
||||
<data name="Cmd_net.wifi.profiles_Desc" xml:space="preserve">
|
||||
<value>List saved Wi-Fi (WLAN) network profiles.</value>
|
||||
</data>
|
||||
<data name="Cmd_net.proxy.show_Title" xml:space="preserve">
|
||||
<value>WinHTTP Proxy</value>
|
||||
</data>
|
||||
<data name="Cmd_net.proxy.show_Desc" xml:space="preserve">
|
||||
<value>Show the system WinHTTP proxy configuration.</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.darkmode.on_Title" xml:space="preserve">
|
||||
<value>Enable Dark Mode</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.darkmode.on_Desc" xml:space="preserve">
|
||||
<value>Switch apps and the system theme to dark mode.</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.darkmode.off_Title" xml:space="preserve">
|
||||
<value>Enable Light Mode</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.darkmode.off_Desc" xml:space="preserve">
|
||||
<value>Switch apps and the system theme back to light mode.</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.win11.taskbarleft_Title" xml:space="preserve">
|
||||
<value>Taskbar: Align Left (Win11)</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.win11.taskbarleft_Desc" xml:space="preserve">
|
||||
<value>Align the Windows 11 taskbar to the left and restart Explorer.</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.win11.taskbarcenter_Title" xml:space="preserve">
|
||||
<value>Taskbar: Align Center (Win11)</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.win11.taskbarcenter_Desc" xml:space="preserve">
|
||||
<value>Center the Windows 11 taskbar and restart Explorer.</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.clockseconds.on_Title" xml:space="preserve">
|
||||
<value>Show Seconds in Clock (Win11)</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.clockseconds.on_Desc" xml:space="preserve">
|
||||
<value>Show seconds in the Windows 11 taskbar clock and restart Explorer.</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.clockseconds.off_Title" xml:space="preserve">
|
||||
<value>Hide Seconds in Clock (Win11)</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.clockseconds.off_Desc" xml:space="preserve">
|
||||
<value>Hide seconds from the Windows 11 taskbar clock and restart Explorer.</value>
|
||||
</data>
|
||||
<data name="Cmd_clean.thumbnailcache_Title" xml:space="preserve">
|
||||
<value>Clear Thumbnail Cache</value>
|
||||
</data>
|
||||
<data name="Cmd_clean.thumbnailcache_Desc" xml:space="preserve">
|
||||
<value>Delete cached thumbnails and restart Explorer to rebuild them.</value>
|
||||
</data>
|
||||
<data name="Cmd_clean.fontcache_Title" xml:space="preserve">
|
||||
<value>Clear Font Cache</value>
|
||||
</data>
|
||||
<data name="Cmd_clean.fontcache_Desc" xml:space="preserve">
|
||||
<value>Stop the Font Cache service, clear its cache and restart it.</value>
|
||||
</data>
|
||||
<data name="Cmd_clean.prefetch_Title" xml:space="preserve">
|
||||
<value>Clear Prefetch</value>
|
||||
</data>
|
||||
<data name="Cmd_clean.prefetch_Desc" xml:space="preserve">
|
||||
<value>Empty the Windows Prefetch folder (rebuilt automatically).</value>
|
||||
</data>
|
||||
<data name="Cmd_power.set.balanced_Title" xml:space="preserve">
|
||||
<value>Set Balanced Plan</value>
|
||||
</data>
|
||||
<data name="Cmd_power.set.balanced_Desc" xml:space="preserve">
|
||||
<value>Activate the Balanced power plan.</value>
|
||||
</data>
|
||||
<data name="Cmd_power.requests_Title" xml:space="preserve">
|
||||
<value>Power Requests</value>
|
||||
</data>
|
||||
<data name="Cmd_power.requests_Desc" xml:space="preserve">
|
||||
<value>Show apps and drivers currently preventing sleep or display off.</value>
|
||||
</data>
|
||||
<data name="Cmd_power.fastboot.off_Title" xml:space="preserve">
|
||||
<value>Disable Fast Startup</value>
|
||||
</data>
|
||||
<data name="Cmd_power.fastboot.off_Desc" xml:space="preserve">
|
||||
<value>Turn off Fast Startup (hybrid boot) for a full shutdown.</value>
|
||||
</data>
|
||||
<data name="Cmd_power.fastboot.on_Title" xml:space="preserve">
|
||||
<value>Enable Fast Startup</value>
|
||||
</data>
|
||||
<data name="Cmd_power.fastboot.on_Desc" xml:space="preserve">
|
||||
<value>Turn on Fast Startup (hybrid boot).</value>
|
||||
</data>
|
||||
<data name="Cmd_diag.taskmgr_Title" xml:space="preserve">
|
||||
<value>Task Manager</value>
|
||||
</data>
|
||||
<data name="Cmd_diag.taskmgr_Desc" xml:space="preserve">
|
||||
<value>Open Task Manager.</value>
|
||||
</data>
|
||||
<data name="Cmd_diag.devmgmt_Title" xml:space="preserve">
|
||||
<value>Device Manager</value>
|
||||
</data>
|
||||
<data name="Cmd_diag.devmgmt_Desc" xml:space="preserve">
|
||||
<value>Open Device Manager.</value>
|
||||
</data>
|
||||
<data name="Cmd_diag.services_Title" xml:space="preserve">
|
||||
<value>Services</value>
|
||||
</data>
|
||||
<data name="Cmd_diag.services_Desc" xml:space="preserve">
|
||||
<value>Open the Services management console.</value>
|
||||
</data>
|
||||
<data name="Cmd_diag.gpresult_Title" xml:space="preserve">
|
||||
<value>Group Policy Result</value>
|
||||
</data>
|
||||
<data name="Cmd_diag.gpresult_Desc" xml:space="preserve">
|
||||
<value>Show the Resultant Set of Policy (RSoP) summary for this PC and user.</value>
|
||||
</data>
|
||||
<data name="Cmd_winget.source.list_Title" xml:space="preserve">
|
||||
<value>List winget Sources</value>
|
||||
</data>
|
||||
<data name="Cmd_winget.source.list_Desc" xml:space="preserve">
|
||||
<value>List the configured winget package sources.</value>
|
||||
</data>
|
||||
<data name="Cmd_store.reset_Title" xml:space="preserve">
|
||||
<value>Reset Microsoft Store</value>
|
||||
</data>
|
||||
<data name="Cmd_store.reset_Desc" xml:space="preserve">
|
||||
<value>Clear the Microsoft Store cache (wsreset).</value>
|
||||
</data>
|
||||
<data name="Cmd_sec.defender.status_Title" xml:space="preserve">
|
||||
<value>Defender Status</value>
|
||||
</data>
|
||||
<data name="Cmd_sec.defender.status_Desc" xml:space="preserve">
|
||||
<value>Show Microsoft Defender protection status and signature version.</value>
|
||||
</data>
|
||||
<data name="Cmd_sec.defender.fullscan_Title" xml:space="preserve">
|
||||
<value>Defender Full Scan</value>
|
||||
</data>
|
||||
<data name="Cmd_sec.defender.fullscan_Desc" xml:space="preserve">
|
||||
<value>Run a full Microsoft Defender antivirus scan (can take a while).</value>
|
||||
</data>
|
||||
<data name="Cmd_sec.firewall.on_Title" xml:space="preserve">
|
||||
<value>Enable Firewall</value>
|
||||
</data>
|
||||
<data name="Cmd_sec.firewall.on_Desc" xml:space="preserve">
|
||||
<value>Turn the Windows Firewall on for all profiles.</value>
|
||||
</data>
|
||||
<data name="Cmd_sec.firewall.off_Title" xml:space="preserve">
|
||||
<value>Disable Firewall</value>
|
||||
</data>
|
||||
<data name="Cmd_sec.firewall.off_Desc" xml:space="preserve">
|
||||
<value>Turn the Windows Firewall off for all profiles. This leaves the PC exposed — re-enable it as soon as possible.</value>
|
||||
</data>
|
||||
<data name="Cmd_dev.wsl.shutdown_Title" xml:space="preserve">
|
||||
<value>Shut Down WSL</value>
|
||||
</data>
|
||||
<data name="Cmd_dev.wsl.shutdown_Desc" xml:space="preserve">
|
||||
<value>Stop all running WSL distributions and the WSL virtual machine.</value>
|
||||
</data>
|
||||
<data name="Cmd_dev.sandbox.off_Title" xml:space="preserve">
|
||||
<value>Disable Windows Sandbox</value>
|
||||
</data>
|
||||
<data name="Cmd_dev.sandbox.off_Desc" xml:space="preserve">
|
||||
<value>Turn off the Windows Sandbox optional feature. Requires a restart.</value>
|
||||
</data>
|
||||
<data name="Cmd_dev.longpaths.on_Title" xml:space="preserve">
|
||||
<value>Enable Long Paths</value>
|
||||
</data>
|
||||
<data name="Cmd_dev.longpaths.on_Desc" xml:space="preserve">
|
||||
<value>Enable Win32 long path (over 260 characters) support.</value>
|
||||
</data>
|
||||
<data name="Cmd_dev.longpaths.off_Title" xml:space="preserve">
|
||||
<value>Disable Long Paths</value>
|
||||
</data>
|
||||
<data name="Cmd_dev.longpaths.off_Desc" xml:space="preserve">
|
||||
<value>Disable Win32 long path support (back to the default).</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1337,4 +1337,232 @@ Tiếp tục?</value>
|
||||
<data name="PortableInfo_LogFolder" xml:space="preserve">
|
||||
<value>Thư mục nhật ký</value>
|
||||
</data>
|
||||
<data name="Cmd_info.hotfixes_Title" xml:space="preserve">
|
||||
<value>Bản cập nhật đã cài</value>
|
||||
</data>
|
||||
<data name="Cmd_info.hotfixes_Desc" xml:space="preserve">
|
||||
<value>Liệt kê các bản cập nhật & hotfix Windows đã cài, mới nhất trước.</value>
|
||||
</data>
|
||||
<data name="Cmd_info.drivers_Title" xml:space="preserve">
|
||||
<value>Driver đã cài</value>
|
||||
</data>
|
||||
<data name="Cmd_info.drivers_Desc" xml:space="preserve">
|
||||
<value>Liệt kê driver thiết bị đã ký kèm phiên bản và nhà cung cấp.</value>
|
||||
</data>
|
||||
<data name="Cmd_info.bios_Title" xml:space="preserve">
|
||||
<value>Thông tin BIOS / Firmware</value>
|
||||
</data>
|
||||
<data name="Cmd_info.bios_Desc" xml:space="preserve">
|
||||
<value>Hiện hãng, phiên bản, số sê-ri và ngày phát hành BIOS.</value>
|
||||
</data>
|
||||
<data name="Cmd_info.env_Title" xml:space="preserve">
|
||||
<value>Biến môi trường</value>
|
||||
</data>
|
||||
<data name="Cmd_info.env_Desc" xml:space="preserve">
|
||||
<value>Liệt kê các biến môi trường hiện tại và giá trị.</value>
|
||||
</data>
|
||||
<data name="Cmd_info.installedapps_Title" xml:space="preserve">
|
||||
<value>Chương trình đã cài</value>
|
||||
</data>
|
||||
<data name="Cmd_info.installedapps_Desc" xml:space="preserve">
|
||||
<value>Liệt kê chương trình đã cài từ khóa Uninstall trong registry.</value>
|
||||
</data>
|
||||
<data name="Cmd_info.monitors_Title" xml:space="preserve">
|
||||
<value>Thông tin màn hình</value>
|
||||
</data>
|
||||
<data name="Cmd_info.monitors_Desc" xml:space="preserve">
|
||||
<value>Hiện màn hình đang kết nối kèm độ phân giải và tần số quét.</value>
|
||||
</data>
|
||||
<data name="Cmd_net.netstat_Title" xml:space="preserve">
|
||||
<value>Kết nối đang hoạt động</value>
|
||||
</data>
|
||||
<data name="Cmd_net.netstat_Desc" xml:space="preserve">
|
||||
<value>Hiện kết nối TCP/UDP và cổng đang lắng nghe kèm PID.</value>
|
||||
</data>
|
||||
<data name="Cmd_net.arp_Title" xml:space="preserve">
|
||||
<value>Bộ nhớ ARP</value>
|
||||
</data>
|
||||
<data name="Cmd_net.arp_Desc" xml:space="preserve">
|
||||
<value>Hiện bảng ARP ánh xạ địa chỉ IP sang MAC.</value>
|
||||
</data>
|
||||
<data name="Cmd_net.route_Title" xml:space="preserve">
|
||||
<value>Bảng định tuyến</value>
|
||||
</data>
|
||||
<data name="Cmd_net.route_Desc" xml:space="preserve">
|
||||
<value>In bảng định tuyến IPv4/IPv6.</value>
|
||||
</data>
|
||||
<data name="Cmd_net.wifi.profiles_Title" xml:space="preserve">
|
||||
<value>Hồ sơ Wi-Fi</value>
|
||||
</data>
|
||||
<data name="Cmd_net.wifi.profiles_Desc" xml:space="preserve">
|
||||
<value>Liệt kê các hồ sơ mạng Wi-Fi (WLAN) đã lưu.</value>
|
||||
</data>
|
||||
<data name="Cmd_net.proxy.show_Title" xml:space="preserve">
|
||||
<value>Proxy WinHTTP</value>
|
||||
</data>
|
||||
<data name="Cmd_net.proxy.show_Desc" xml:space="preserve">
|
||||
<value>Hiện cấu hình proxy WinHTTP của hệ thống.</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.darkmode.on_Title" xml:space="preserve">
|
||||
<value>Bật chế độ tối</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.darkmode.on_Desc" xml:space="preserve">
|
||||
<value>Chuyển ứng dụng và giao diện hệ thống sang chế độ tối.</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.darkmode.off_Title" xml:space="preserve">
|
||||
<value>Bật chế độ sáng</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.darkmode.off_Desc" xml:space="preserve">
|
||||
<value>Chuyển ứng dụng và giao diện hệ thống về chế độ sáng.</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.win11.taskbarleft_Title" xml:space="preserve">
|
||||
<value>Thanh tác vụ: căn trái (Win11)</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.win11.taskbarleft_Desc" xml:space="preserve">
|
||||
<value>Căn thanh tác vụ Windows 11 về bên trái và khởi động lại Explorer.</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.win11.taskbarcenter_Title" xml:space="preserve">
|
||||
<value>Thanh tác vụ: căn giữa (Win11)</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.win11.taskbarcenter_Desc" xml:space="preserve">
|
||||
<value>Căn giữa thanh tác vụ Windows 11 và khởi động lại Explorer.</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.clockseconds.on_Title" xml:space="preserve">
|
||||
<value>Hiện giây trên đồng hồ (Win11)</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.clockseconds.on_Desc" xml:space="preserve">
|
||||
<value>Hiện giây trên đồng hồ thanh tác vụ Windows 11 và khởi động lại Explorer.</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.clockseconds.off_Title" xml:space="preserve">
|
||||
<value>Ẩn giây trên đồng hồ (Win11)</value>
|
||||
</data>
|
||||
<data name="Cmd_tweak.clockseconds.off_Desc" xml:space="preserve">
|
||||
<value>Ẩn giây trên đồng hồ thanh tác vụ Windows 11 và khởi động lại Explorer.</value>
|
||||
</data>
|
||||
<data name="Cmd_clean.thumbnailcache_Title" xml:space="preserve">
|
||||
<value>Xóa cache ảnh thu nhỏ</value>
|
||||
</data>
|
||||
<data name="Cmd_clean.thumbnailcache_Desc" xml:space="preserve">
|
||||
<value>Xóa ảnh thu nhỏ đã lưu và khởi động lại Explorer để dựng lại.</value>
|
||||
</data>
|
||||
<data name="Cmd_clean.fontcache_Title" xml:space="preserve">
|
||||
<value>Xóa cache phông chữ</value>
|
||||
</data>
|
||||
<data name="Cmd_clean.fontcache_Desc" xml:space="preserve">
|
||||
<value>Dừng dịch vụ Font Cache, xóa cache và khởi động lại dịch vụ.</value>
|
||||
</data>
|
||||
<data name="Cmd_clean.prefetch_Title" xml:space="preserve">
|
||||
<value>Xóa Prefetch</value>
|
||||
</data>
|
||||
<data name="Cmd_clean.prefetch_Desc" xml:space="preserve">
|
||||
<value>Làm trống thư mục Prefetch của Windows (tự dựng lại).</value>
|
||||
</data>
|
||||
<data name="Cmd_power.set.balanced_Title" xml:space="preserve">
|
||||
<value>Đặt gói Cân bằng</value>
|
||||
</data>
|
||||
<data name="Cmd_power.set.balanced_Desc" xml:space="preserve">
|
||||
<value>Kích hoạt gói nguồn Cân bằng (Balanced).</value>
|
||||
</data>
|
||||
<data name="Cmd_power.requests_Title" xml:space="preserve">
|
||||
<value>Yêu cầu nguồn</value>
|
||||
</data>
|
||||
<data name="Cmd_power.requests_Desc" xml:space="preserve">
|
||||
<value>Hiện ứng dụng/driver đang ngăn máy ngủ hoặc tắt màn hình.</value>
|
||||
</data>
|
||||
<data name="Cmd_power.fastboot.off_Title" xml:space="preserve">
|
||||
<value>Tắt Khởi động nhanh</value>
|
||||
</data>
|
||||
<data name="Cmd_power.fastboot.off_Desc" xml:space="preserve">
|
||||
<value>Tắt Fast Startup (hybrid boot) để tắt máy hoàn toàn.</value>
|
||||
</data>
|
||||
<data name="Cmd_power.fastboot.on_Title" xml:space="preserve">
|
||||
<value>Bật Khởi động nhanh</value>
|
||||
</data>
|
||||
<data name="Cmd_power.fastboot.on_Desc" xml:space="preserve">
|
||||
<value>Bật Fast Startup (hybrid boot).</value>
|
||||
</data>
|
||||
<data name="Cmd_diag.taskmgr_Title" xml:space="preserve">
|
||||
<value>Trình quản lý tác vụ</value>
|
||||
</data>
|
||||
<data name="Cmd_diag.taskmgr_Desc" xml:space="preserve">
|
||||
<value>Mở Task Manager.</value>
|
||||
</data>
|
||||
<data name="Cmd_diag.devmgmt_Title" xml:space="preserve">
|
||||
<value>Trình quản lý thiết bị</value>
|
||||
</data>
|
||||
<data name="Cmd_diag.devmgmt_Desc" xml:space="preserve">
|
||||
<value>Mở Device Manager.</value>
|
||||
</data>
|
||||
<data name="Cmd_diag.services_Title" xml:space="preserve">
|
||||
<value>Dịch vụ</value>
|
||||
</data>
|
||||
<data name="Cmd_diag.services_Desc" xml:space="preserve">
|
||||
<value>Mở bảng quản lý Dịch vụ (Services).</value>
|
||||
</data>
|
||||
<data name="Cmd_diag.gpresult_Title" xml:space="preserve">
|
||||
<value>Kết quả Group Policy</value>
|
||||
</data>
|
||||
<data name="Cmd_diag.gpresult_Desc" xml:space="preserve">
|
||||
<value>Hiện tóm tắt Resultant Set of Policy (RSoP) cho máy và người dùng này.</value>
|
||||
</data>
|
||||
<data name="Cmd_winget.source.list_Title" xml:space="preserve">
|
||||
<value>Liệt kê nguồn winget</value>
|
||||
</data>
|
||||
<data name="Cmd_winget.source.list_Desc" xml:space="preserve">
|
||||
<value>Liệt kê các nguồn gói winget đã cấu hình.</value>
|
||||
</data>
|
||||
<data name="Cmd_store.reset_Title" xml:space="preserve">
|
||||
<value>Đặt lại Microsoft Store</value>
|
||||
</data>
|
||||
<data name="Cmd_store.reset_Desc" xml:space="preserve">
|
||||
<value>Xóa cache Microsoft Store (wsreset).</value>
|
||||
</data>
|
||||
<data name="Cmd_sec.defender.status_Title" xml:space="preserve">
|
||||
<value>Trạng thái Defender</value>
|
||||
</data>
|
||||
<data name="Cmd_sec.defender.status_Desc" xml:space="preserve">
|
||||
<value>Hiện trạng thái bảo vệ và phiên bản định nghĩa của Microsoft Defender.</value>
|
||||
</data>
|
||||
<data name="Cmd_sec.defender.fullscan_Title" xml:space="preserve">
|
||||
<value>Defender quét toàn bộ</value>
|
||||
</data>
|
||||
<data name="Cmd_sec.defender.fullscan_Desc" xml:space="preserve">
|
||||
<value>Chạy quét toàn bộ Microsoft Defender (có thể lâu).</value>
|
||||
</data>
|
||||
<data name="Cmd_sec.firewall.on_Title" xml:space="preserve">
|
||||
<value>Bật tường lửa</value>
|
||||
</data>
|
||||
<data name="Cmd_sec.firewall.on_Desc" xml:space="preserve">
|
||||
<value>Bật Windows Firewall cho mọi hồ sơ.</value>
|
||||
</data>
|
||||
<data name="Cmd_sec.firewall.off_Title" xml:space="preserve">
|
||||
<value>Tắt tường lửa</value>
|
||||
</data>
|
||||
<data name="Cmd_sec.firewall.off_Desc" xml:space="preserve">
|
||||
<value>Tắt Windows Firewall cho mọi hồ sơ. Việc này khiến máy mất bảo vệ — hãy bật lại sớm nhất có thể.</value>
|
||||
</data>
|
||||
<data name="Cmd_dev.wsl.shutdown_Title" xml:space="preserve">
|
||||
<value>Tắt WSL</value>
|
||||
</data>
|
||||
<data name="Cmd_dev.wsl.shutdown_Desc" xml:space="preserve">
|
||||
<value>Dừng mọi distro WSL đang chạy và máy ảo WSL.</value>
|
||||
</data>
|
||||
<data name="Cmd_dev.sandbox.off_Title" xml:space="preserve">
|
||||
<value>Tắt Windows Sandbox</value>
|
||||
</data>
|
||||
<data name="Cmd_dev.sandbox.off_Desc" xml:space="preserve">
|
||||
<value>Tắt tính năng tùy chọn Windows Sandbox. Cần khởi động lại.</value>
|
||||
</data>
|
||||
<data name="Cmd_dev.longpaths.on_Title" xml:space="preserve">
|
||||
<value>Bật đường dẫn dài</value>
|
||||
</data>
|
||||
<data name="Cmd_dev.longpaths.on_Desc" xml:space="preserve">
|
||||
<value>Bật hỗ trợ đường dẫn dài Win32 (hơn 260 ký tự).</value>
|
||||
</data>
|
||||
<data name="Cmd_dev.longpaths.off_Title" xml:space="preserve">
|
||||
<value>Tắt đường dẫn dài</value>
|
||||
</data>
|
||||
<data name="Cmd_dev.longpaths.off_Desc" xml:space="preserve">
|
||||
<value>Tắt hỗ trợ đường dẫn dài Win32 (về mặc định).</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -17,7 +17,12 @@ internal sealed record CatalogViewModels(
|
||||
/// </summary>
|
||||
internal static class CatalogViewModelBuilder
|
||||
{
|
||||
public static CatalogViewModels Build(ICatalogProvider catalog)
|
||||
/// <summary>
|
||||
/// Projects the catalog to view-models, hiding commands that do not apply to the current OS build
|
||||
/// (e.g. Windows 11-only tweaks on Windows 10). The hidden commands never reach the list, palette,
|
||||
/// category counts or any dashboard.
|
||||
/// </summary>
|
||||
public static CatalogViewModels Build(ICatalogProvider catalog, int currentOsBuild)
|
||||
{
|
||||
var categoryTitles = catalog.GetCategories()
|
||||
.ToDictionary(c => c.Id, c => Strings.Get(c.TitleKey), StringComparer.Ordinal);
|
||||
@@ -26,6 +31,11 @@ internal static class CatalogViewModelBuilder
|
||||
var searchable = new List<SearchableCommand>();
|
||||
foreach (var command in catalog.GetCommands())
|
||||
{
|
||||
if (!command.AppliesToOsBuild(currentOsBuild))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var title = Strings.Get(command.TitleKey);
|
||||
var description = Strings.Get(command.DescriptionKey);
|
||||
items.Add(new CommandItemViewModel(command, title, description));
|
||||
|
||||
@@ -12,10 +12,11 @@ public sealed partial class CommandPaletteViewModel : ObservableObject
|
||||
private readonly IReadOnlyList<SearchableCommand> _searchable;
|
||||
private readonly Dictionary<string, CommandItemViewModel> _itemsById;
|
||||
|
||||
public CommandPaletteViewModel(ICatalogProvider catalog)
|
||||
public CommandPaletteViewModel(ICatalogProvider catalog, ISystemInfoService systemInfo)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(catalog);
|
||||
var vms = CatalogViewModelBuilder.Build(catalog);
|
||||
ArgumentNullException.ThrowIfNull(systemInfo);
|
||||
var vms = CatalogViewModelBuilder.Build(catalog, systemInfo.GetStatus().OsBuild);
|
||||
_searchable = vms.Searchable;
|
||||
_itemsById = vms.Items.ToDictionary(i => i.Command.Id, StringComparer.Ordinal);
|
||||
ApplyFilter();
|
||||
|
||||
@@ -31,6 +31,7 @@ public sealed partial class MainViewModel : ObservableObject
|
||||
private readonly IRegistryService _registry;
|
||||
private readonly Dictionary<string, CommandItemViewModel> _itemsById;
|
||||
private readonly CommandDefinition? _restorePointCommand;
|
||||
private readonly int _osBuild;
|
||||
private IReadOnlyList<SearchableCommand> _searchable;
|
||||
private IReadOnlyDictionary<string, string> _categoryTitles;
|
||||
|
||||
@@ -89,7 +90,8 @@ public sealed partial class MainViewModel : ObservableObject
|
||||
}
|
||||
};
|
||||
|
||||
var vms = CatalogViewModelBuilder.Build(catalog);
|
||||
_osBuild = systemInfo.GetStatus().OsBuild;
|
||||
var vms = CatalogViewModelBuilder.Build(catalog, _osBuild);
|
||||
_searchable = vms.Searchable;
|
||||
_categoryTitles = vms.CategoryTitles;
|
||||
_itemsById = vms.Items.ToDictionary(i => i.Command.Id, StringComparer.Ordinal);
|
||||
@@ -472,7 +474,7 @@ public sealed partial class MainViewModel : ObservableObject
|
||||
{
|
||||
// Rebuild the search corpus + category-title map in the new language, and refresh the
|
||||
// already-displayed item/category/detail view-models in place.
|
||||
var vms = CatalogViewModelBuilder.Build(_catalog);
|
||||
var vms = CatalogViewModelBuilder.Build(_catalog, _osBuild);
|
||||
_searchable = vms.Searchable;
|
||||
_categoryTitles = vms.CategoryTitles;
|
||||
|
||||
|
||||
@@ -135,9 +135,10 @@ public sealed partial class RecipesViewModel : ObservableObject
|
||||
[RelayCommand]
|
||||
private void AddStep()
|
||||
{
|
||||
if (CommandToAdd is not null)
|
||||
// Avoid duplicate steps — a recipe runs each command once (don't run one command N times).
|
||||
if (CommandToAdd is { } command && !Steps.Contains(command))
|
||||
{
|
||||
Steps.Add(CommandToAdd);
|
||||
Steps.Add(command);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
new LanguageOption("", Strings.Get("LanguageOption_System")),
|
||||
new LanguageOption("en", "English"),
|
||||
new LanguageOption("vi", "Tiếng Việt"),
|
||||
new LanguageOption("ja", "日本語"),
|
||||
];
|
||||
|
||||
// Initialize from persisted settings directly (field assignment skips the apply/save hooks).
|
||||
|
||||
@@ -155,10 +155,12 @@ public sealed partial class UserCommandsViewModel : ObservableObject
|
||||
Arguments = EditArguments.Trim(),
|
||||
};
|
||||
|
||||
// Transparency (Security.md §3): show the exact command line, and that it runs without admin.
|
||||
var commandLine = string.IsNullOrEmpty(userCommand.Arguments)
|
||||
// Transparency (Security.md §3): show the exact command line that will run (including the
|
||||
// cmd /c normalization applied by ToDefinition) and that it runs without admin.
|
||||
var effectiveArgs = UserCommandFactory.NormalizeArguments(executable, userCommand.Arguments);
|
||||
var commandLine = string.IsNullOrEmpty(effectiveArgs)
|
||||
? executable
|
||||
: executable + " " + userCommand.Arguments;
|
||||
: executable + " " + effectiveArgs;
|
||||
if (MessageBox.Show(
|
||||
string.Format(CultureInfo.CurrentCulture, Strings.Get("UserCmd_RunConfirm"), commandLine),
|
||||
Strings.Get("UserCmd_RunTitle"),
|
||||
|
||||
@@ -110,6 +110,9 @@
|
||||
<MenuItem Header="Tiếng Việt" Command="{Binding Settings.SetLanguageCommand}"
|
||||
CommandParameter="vi"
|
||||
IsChecked="{Binding Settings.SelectedLanguage.Code, Converter={StaticResource StringEquals}, ConverterParameter=vi, Mode=OneWay}" />
|
||||
<MenuItem Header="日本語" Command="{Binding Settings.SetLanguageCommand}"
|
||||
CommandParameter="ja"
|
||||
IsChecked="{Binding Settings.SelectedLanguage.Code, Converter={StaticResource StringEquals}, ConverterParameter=ja, Mode=OneWay}" />
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Header="{res:Loc MenuToggleSidebar}" Command="{Binding ToggleSidebarCommand}" InputGestureText="Ctrl+B" />
|
||||
@@ -231,7 +234,8 @@
|
||||
<ListBox ItemsSource="{Binding Categories}" SelectedItem="{Binding SelectedCategory}"
|
||||
Background="Transparent" BorderThickness="0" Padding="4,4"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Hidden">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
|
||||
<Setter Property="Padding" Value="12,8" />
|
||||
|
||||
@@ -47,4 +47,72 @@ public sealed class CatalogValidationErrorsTests
|
||||
|
||||
Assert.Empty(result.Errors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Build_MaxOsBuildBelowMinOsBuild_ProducesError()
|
||||
{
|
||||
var categories = new[] { new CategoryDto { Id = "cat", TitleKey = "Cat_K" } };
|
||||
var commands = new[]
|
||||
{
|
||||
new CommandDto
|
||||
{
|
||||
Id = "c1",
|
||||
CategoryId = "cat",
|
||||
TitleKey = "T",
|
||||
DescriptionKey = "D",
|
||||
Executable = "cmd",
|
||||
MinOsBuild = 22000,
|
||||
MaxOsBuild = 19045,
|
||||
},
|
||||
};
|
||||
|
||||
var result = CatalogLoader.Build(categories, commands);
|
||||
|
||||
Assert.Contains(result.Errors, e => e.Contains("c1", StringComparison.Ordinal) && e.Contains("maxOsBuild", StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Build_NonPositiveOsBuild_ProducesError()
|
||||
{
|
||||
var categories = new[] { new CategoryDto { Id = "cat", TitleKey = "Cat_K" } };
|
||||
var commands = new[]
|
||||
{
|
||||
new CommandDto
|
||||
{
|
||||
Id = "c1",
|
||||
CategoryId = "cat",
|
||||
TitleKey = "T",
|
||||
DescriptionKey = "D",
|
||||
Executable = "cmd",
|
||||
MinOsBuild = 0,
|
||||
},
|
||||
};
|
||||
|
||||
var result = CatalogLoader.Build(categories, commands);
|
||||
|
||||
Assert.Contains(result.Errors, e => e.Contains("c1", StringComparison.Ordinal) && e.Contains("minOsBuild", StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Build_ValidOsBuildRange_HasNoErrors()
|
||||
{
|
||||
var categories = new[] { new CategoryDto { Id = "cat", TitleKey = "Cat_K" } };
|
||||
var commands = new[]
|
||||
{
|
||||
new CommandDto
|
||||
{
|
||||
Id = "c1",
|
||||
CategoryId = "cat",
|
||||
TitleKey = "T",
|
||||
DescriptionKey = "D",
|
||||
Executable = "cmd",
|
||||
MinOsBuild = 22000,
|
||||
},
|
||||
};
|
||||
|
||||
var result = CatalogLoader.Build(categories, commands);
|
||||
|
||||
Assert.Empty(result.Errors);
|
||||
Assert.Equal(22000, result.Commands[0].MinOsBuild);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
using CommandForge.Domain;
|
||||
using CommandForge.Infrastructure.Catalog;
|
||||
|
||||
namespace CommandForge.Tests;
|
||||
|
||||
/// <summary>Verifies the OS-build applicability predicate and the embedded catalog's version gating.</summary>
|
||||
public sealed class CommandDefinitionTests
|
||||
{
|
||||
private static CommandDefinition Command(int? min = null, int? max = null) => new()
|
||||
{
|
||||
Id = "t",
|
||||
CategoryId = "c",
|
||||
TitleKey = "T",
|
||||
DescriptionKey = "D",
|
||||
Executable = "cmd",
|
||||
MinOsBuild = min,
|
||||
MaxOsBuild = max,
|
||||
};
|
||||
|
||||
[Theory]
|
||||
[InlineData(19045, true)] // no bounds -> always applies
|
||||
[InlineData(22631, true)]
|
||||
public void AppliesToOsBuild_NoBounds_AlwaysTrue(int build, bool expected)
|
||||
=> Assert.Equal(expected, Command().AppliesToOsBuild(build));
|
||||
|
||||
[Theory]
|
||||
[InlineData(19045, false)] // Windows 10 excluded by min 22000
|
||||
[InlineData(21999, false)]
|
||||
[InlineData(22000, true)] // inclusive lower bound
|
||||
[InlineData(26100, true)]
|
||||
public void AppliesToOsBuild_MinOnly_GatesBelow(int build, bool expected)
|
||||
=> Assert.Equal(expected, Command(min: 22000).AppliesToOsBuild(build));
|
||||
|
||||
[Theory]
|
||||
[InlineData(19045, true)] // inclusive upper bound (Windows 10 only)
|
||||
[InlineData(22000, false)] // Windows 11 excluded by max 19045
|
||||
public void AppliesToOsBuild_MaxOnly_GatesAbove(int build, bool expected)
|
||||
=> Assert.Equal(expected, Command(max: 19045).AppliesToOsBuild(build));
|
||||
|
||||
[Theory]
|
||||
[InlineData(21999, false)]
|
||||
[InlineData(22000, true)]
|
||||
[InlineData(22621, true)]
|
||||
[InlineData(22622, false)]
|
||||
public void AppliesToOsBuild_Range_GatesBothEnds(int build, bool expected)
|
||||
=> Assert.Equal(expected, Command(min: 22000, max: 22621).AppliesToOsBuild(build));
|
||||
|
||||
[Theory]
|
||||
[InlineData("tweak.win11.classicmenu", 22000)]
|
||||
[InlineData("tweak.win11.modernmenu", 22000)]
|
||||
[InlineData("tweak.win11.taskbarleft", 22000)]
|
||||
[InlineData("tweak.win11.taskbarcenter", 22000)]
|
||||
[InlineData("tweak.clockseconds.on", 22621)]
|
||||
[InlineData("tweak.clockseconds.off", 22621)]
|
||||
public void EmbeddedCatalog_Win11Commands_AreGated(string id, int expectedMinBuild)
|
||||
{
|
||||
var catalog = CatalogLoader.LoadEmbedded();
|
||||
var command = catalog.Commands.Single(c => c.Id == id);
|
||||
Assert.Equal(expectedMinBuild, command.MinOsBuild);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EmbeddedCatalog_Win11Tweaks_HiddenOnWindows10()
|
||||
{
|
||||
const int windows10Build = 19045;
|
||||
var catalog = CatalogLoader.LoadEmbedded();
|
||||
var hiddenOnWin10 = catalog.Commands.Where(c => !c.AppliesToOsBuild(windows10Build)).Select(c => c.Id).ToHashSet();
|
||||
|
||||
Assert.Contains("tweak.win11.taskbarleft", hiddenOnWin10);
|
||||
Assert.Contains("tweak.clockseconds.on", hiddenOnWin10);
|
||||
Assert.DoesNotContain("dism.checkhealth", hiddenOnWin10); // ungated commands stay visible
|
||||
}
|
||||
}
|
||||
@@ -6,45 +6,48 @@ using CommandForge.Wpf.Resources;
|
||||
namespace CommandForge.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Cross-checks that every catalog title/description resource key exists in both the neutral
|
||||
/// (EN) resources and the Vietnamese satellite (no parent fallback).
|
||||
/// Cross-checks that every catalog title/description and UI resource key exists in the neutral
|
||||
/// (EN) resources and in both the Vietnamese and Japanese satellites (no parent fallback), so a
|
||||
/// missing translation fails the build rather than silently falling back to English.
|
||||
/// </summary>
|
||||
public sealed class ResxKeyTests
|
||||
{
|
||||
private static readonly CatalogLoadResult Catalog = CatalogLoader.LoadEmbedded();
|
||||
|
||||
[Fact]
|
||||
public void Catalog_AllKeys_ExistInResx_EN_and_VI()
|
||||
/// <summary>Asserts every key resolves in EN (neutral) and in the VI and JA satellites without fallback.</summary>
|
||||
private static void AssertKeysExist(IEnumerable<string> keys)
|
||||
{
|
||||
var manager = new ResourceManager("CommandForge.Wpf.Resources.Strings", typeof(Strings).Assembly);
|
||||
var english = manager.GetResourceSet(CultureInfo.InvariantCulture, createIfNotExists: true, tryParents: true);
|
||||
var vietnamese = manager.GetResourceSet(new CultureInfo("vi"), createIfNotExists: true, tryParents: false);
|
||||
var japanese = manager.GetResourceSet(new CultureInfo("ja"), createIfNotExists: true, tryParents: false);
|
||||
|
||||
Assert.NotNull(english);
|
||||
Assert.NotNull(vietnamese);
|
||||
|
||||
var keys = new List<string>();
|
||||
keys.AddRange(Catalog.Categories.Select(c => c.TitleKey));
|
||||
keys.AddRange(Catalog.Commands.Select(c => c.TitleKey));
|
||||
keys.AddRange(Catalog.Commands.Select(c => c.DescriptionKey));
|
||||
Assert.NotNull(japanese);
|
||||
|
||||
foreach (var key in keys)
|
||||
{
|
||||
Assert.True(english!.GetString(key) is not null, $"Missing EN resource for key '{key}'.");
|
||||
Assert.True(vietnamese!.GetString(key) is not null, $"Missing VI resource for key '{key}'.");
|
||||
Assert.True(japanese!.GetString(key) is not null, $"Missing JA resource for key '{key}'.");
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SettingsUiKeys_ExistInResx_EN_and_VI()
|
||||
public void Catalog_AllKeys_ExistInResx_AllCultures()
|
||||
{
|
||||
var manager = new ResourceManager("CommandForge.Wpf.Resources.Strings", typeof(Strings).Assembly);
|
||||
var english = manager.GetResourceSet(CultureInfo.InvariantCulture, createIfNotExists: true, tryParents: true);
|
||||
var vietnamese = manager.GetResourceSet(new CultureInfo("vi"), createIfNotExists: true, tryParents: false);
|
||||
var keys = new List<string>();
|
||||
keys.AddRange(Catalog.Categories.Select(c => c.TitleKey));
|
||||
keys.AddRange(Catalog.Commands.Select(c => c.TitleKey));
|
||||
keys.AddRange(Catalog.Commands.Select(c => c.DescriptionKey));
|
||||
|
||||
Assert.NotNull(english);
|
||||
Assert.NotNull(vietnamese);
|
||||
AssertKeysExist(keys);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SettingsUiKeys_ExistInResx_AllCultures()
|
||||
{
|
||||
string[] keys =
|
||||
[
|
||||
"Menu_OpenSettings", "LanguageOption_System",
|
||||
@@ -63,23 +66,12 @@ public sealed class ResxKeyTests
|
||||
"Settings_ImportInvalid", "Settings_ImportSuccess", "Settings_ProfileApplied", "Settings_DeleteProfileConfirm",
|
||||
];
|
||||
|
||||
foreach (var key in keys)
|
||||
{
|
||||
Assert.True(english!.GetString(key) is not null, $"Missing EN resource for key '{key}'.");
|
||||
Assert.True(vietnamese!.GetString(key) is not null, $"Missing VI resource for key '{key}'.");
|
||||
}
|
||||
AssertKeysExist(keys);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DiagnosticsUiKeys_ExistInResx_EN_and_VI()
|
||||
public void DiagnosticsUiKeys_ExistInResx_AllCultures()
|
||||
{
|
||||
var manager = new ResourceManager("CommandForge.Wpf.Resources.Strings", typeof(Strings).Assembly);
|
||||
var english = manager.GetResourceSet(CultureInfo.InvariantCulture, createIfNotExists: true, tryParents: true);
|
||||
var vietnamese = manager.GetResourceSet(new CultureInfo("vi"), createIfNotExists: true, tryParents: false);
|
||||
|
||||
Assert.NotNull(english);
|
||||
Assert.NotNull(vietnamese);
|
||||
|
||||
string[] keys =
|
||||
[
|
||||
"Menu_LogViewer", "Menu_ExportLogs", "Menu_DebugPanel", "Menu_ReportBug",
|
||||
@@ -97,23 +89,12 @@ public sealed class ResxKeyTests
|
||||
"Settings_OpenDebugPanel", "Settings_ResetDefaults", "Settings_ResetConfirm",
|
||||
];
|
||||
|
||||
foreach (var key in keys)
|
||||
{
|
||||
Assert.True(english!.GetString(key) is not null, $"Missing EN resource for key '{key}'.");
|
||||
Assert.True(vietnamese!.GetString(key) is not null, $"Missing VI resource for key '{key}'.");
|
||||
}
|
||||
AssertKeysExist(keys);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HomeUiKeys_ExistInResx_EN_and_VI()
|
||||
public void HomeUiKeys_ExistInResx_AllCultures()
|
||||
{
|
||||
var manager = new ResourceManager("CommandForge.Wpf.Resources.Strings", typeof(Strings).Assembly);
|
||||
var english = manager.GetResourceSet(CultureInfo.InvariantCulture, createIfNotExists: true, tryParents: true);
|
||||
var vietnamese = manager.GetResourceSet(new CultureInfo("vi"), createIfNotExists: true, tryParents: false);
|
||||
|
||||
Assert.NotNull(english);
|
||||
Assert.NotNull(vietnamese);
|
||||
|
||||
string[] keys =
|
||||
[
|
||||
"SidebarHome", "SidebarFavorites", "Favorite_Toggle",
|
||||
@@ -123,23 +104,12 @@ public sealed class ResxKeyTests
|
||||
"Home_Recent", "Home_NoRecent", "Home_NoFavorites",
|
||||
];
|
||||
|
||||
foreach (var key in keys)
|
||||
{
|
||||
Assert.True(english!.GetString(key) is not null, $"Missing EN resource for key '{key}'.");
|
||||
Assert.True(vietnamese!.GetString(key) is not null, $"Missing VI resource for key '{key}'.");
|
||||
}
|
||||
AssertKeysExist(keys);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LegalUiKeys_ExistInResx_EN_and_VI()
|
||||
public void LegalUiKeys_ExistInResx_AllCultures()
|
||||
{
|
||||
var manager = new ResourceManager("CommandForge.Wpf.Resources.Strings", typeof(Strings).Assembly);
|
||||
var english = manager.GetResourceSet(CultureInfo.InvariantCulture, createIfNotExists: true, tryParents: true);
|
||||
var vietnamese = manager.GetResourceSet(new CultureInfo("vi"), createIfNotExists: true, tryParents: false);
|
||||
|
||||
Assert.NotNull(english);
|
||||
Assert.NotNull(vietnamese);
|
||||
|
||||
string[] keys =
|
||||
[
|
||||
"LegalGateTitle", "LegalGateIntro", "LegalGateAgree", "LegalGateContinue", "LegalGateExit",
|
||||
@@ -148,23 +118,12 @@ public sealed class ResxKeyTests
|
||||
"LegalViewer_Title",
|
||||
];
|
||||
|
||||
foreach (var key in keys)
|
||||
{
|
||||
Assert.True(english!.GetString(key) is not null, $"Missing EN resource for key '{key}'.");
|
||||
Assert.True(vietnamese!.GetString(key) is not null, $"Missing VI resource for key '{key}'.");
|
||||
}
|
||||
AssertKeysExist(keys);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MenuUiKeys_ExistInResx_EN_and_VI()
|
||||
public void MenuUiKeys_ExistInResx_AllCultures()
|
||||
{
|
||||
var manager = new ResourceManager("CommandForge.Wpf.Resources.Strings", typeof(Strings).Assembly);
|
||||
var english = manager.GetResourceSet(CultureInfo.InvariantCulture, createIfNotExists: true, tryParents: true);
|
||||
var vietnamese = manager.GetResourceSet(new CultureInfo("vi"), createIfNotExists: true, tryParents: false);
|
||||
|
||||
Assert.NotNull(english);
|
||||
Assert.NotNull(vietnamese);
|
||||
|
||||
string[] keys =
|
||||
[
|
||||
"MenuFile", "MenuView", "MenuTools", "MenuAbout", "MenuHelp", "MenuExit", "MenuToggleSidebar",
|
||||
@@ -176,23 +135,12 @@ public sealed class ResxKeyTests
|
||||
"Menu_KeyboardShortcuts", "Menu_PortableInfo", "Menu_RestorePoint",
|
||||
];
|
||||
|
||||
foreach (var key in keys)
|
||||
{
|
||||
Assert.True(english!.GetString(key) is not null, $"Missing EN resource for key '{key}'.");
|
||||
Assert.True(vietnamese!.GetString(key) is not null, $"Missing VI resource for key '{key}'.");
|
||||
}
|
||||
AssertKeysExist(keys);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DialogUiKeys_ExistInResx_EN_and_VI()
|
||||
public void DialogUiKeys_ExistInResx_AllCultures()
|
||||
{
|
||||
var manager = new ResourceManager("CommandForge.Wpf.Resources.Strings", typeof(Strings).Assembly);
|
||||
var english = manager.GetResourceSet(CultureInfo.InvariantCulture, createIfNotExists: true, tryParents: true);
|
||||
var vietnamese = manager.GetResourceSet(new CultureInfo("vi"), createIfNotExists: true, tryParents: false);
|
||||
|
||||
Assert.NotNull(english);
|
||||
Assert.NotNull(vietnamese);
|
||||
|
||||
string[] keys =
|
||||
[
|
||||
"Shortcuts_Palette", "Shortcuts_ListNav", "Shortcuts_OpenSelected", "Shortcuts_CloseDialog",
|
||||
@@ -201,23 +149,12 @@ public sealed class ResxKeyTests
|
||||
"Settings_CurrentVersion", "Settings_NoDataCollected", "LanguageOption_System",
|
||||
];
|
||||
|
||||
foreach (var key in keys)
|
||||
{
|
||||
Assert.True(english!.GetString(key) is not null, $"Missing EN resource for key '{key}'.");
|
||||
Assert.True(vietnamese!.GetString(key) is not null, $"Missing VI resource for key '{key}'.");
|
||||
}
|
||||
AssertKeysExist(keys);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RecipesUiKeys_ExistInResx_EN_and_VI()
|
||||
public void RecipesUiKeys_ExistInResx_AllCultures()
|
||||
{
|
||||
var manager = new ResourceManager("CommandForge.Wpf.Resources.Strings", typeof(Strings).Assembly);
|
||||
var english = manager.GetResourceSet(CultureInfo.InvariantCulture, createIfNotExists: true, tryParents: true);
|
||||
var vietnamese = manager.GetResourceSet(new CultureInfo("vi"), createIfNotExists: true, tryParents: false);
|
||||
|
||||
Assert.NotNull(english);
|
||||
Assert.NotNull(vietnamese);
|
||||
|
||||
string[] keys =
|
||||
[
|
||||
"SidebarRecipes", "Recipes_Saved", "Recipes_New", "Recipe_Delete", "Recipes_NameHint",
|
||||
@@ -227,23 +164,12 @@ public sealed class ResxKeyTests
|
||||
"Recipe_ContainsDangerous", "Recipe_ConfirmTitle", "Recipe_DeleteConfirm",
|
||||
];
|
||||
|
||||
foreach (var key in keys)
|
||||
{
|
||||
Assert.True(english!.GetString(key) is not null, $"Missing EN resource for key '{key}'.");
|
||||
Assert.True(vietnamese!.GetString(key) is not null, $"Missing VI resource for key '{key}'.");
|
||||
}
|
||||
AssertKeysExist(keys);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void UserCommandsUiKeys_ExistInResx_EN_and_VI()
|
||||
public void UserCommandsUiKeys_ExistInResx_AllCultures()
|
||||
{
|
||||
var manager = new ResourceManager("CommandForge.Wpf.Resources.Strings", typeof(Strings).Assembly);
|
||||
var english = manager.GetResourceSet(CultureInfo.InvariantCulture, createIfNotExists: true, tryParents: true);
|
||||
var vietnamese = manager.GetResourceSet(new CultureInfo("vi"), createIfNotExists: true, tryParents: false);
|
||||
|
||||
Assert.NotNull(english);
|
||||
Assert.NotNull(vietnamese);
|
||||
|
||||
string[] keys =
|
||||
[
|
||||
"SidebarUserCommands", "UserCmd_Warning", "UserCmd_Saved", "UserCmd_New", "UserCmd_Delete",
|
||||
@@ -251,54 +177,28 @@ public sealed class ResxKeyTests
|
||||
"UserCmd_NoCommands", "UserCmd_RunTitle", "UserCmd_RunConfirm", "UserCmd_DeleteConfirm",
|
||||
];
|
||||
|
||||
foreach (var key in keys)
|
||||
{
|
||||
Assert.True(english!.GetString(key) is not null, $"Missing EN resource for key '{key}'.");
|
||||
Assert.True(vietnamese!.GetString(key) is not null, $"Missing VI resource for key '{key}'.");
|
||||
}
|
||||
AssertKeysExist(keys);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RegistryAndUndoUiKeys_ExistInResx_EN_and_VI()
|
||||
public void RegistryAndUndoUiKeys_ExistInResx_AllCultures()
|
||||
{
|
||||
var manager = new ResourceManager("CommandForge.Wpf.Resources.Strings", typeof(Strings).Assembly);
|
||||
var english = manager.GetResourceSet(CultureInfo.InvariantCulture, createIfNotExists: true, tryParents: true);
|
||||
var vietnamese = manager.GetResourceSet(new CultureInfo("vi"), createIfNotExists: true, tryParents: false);
|
||||
|
||||
Assert.NotNull(english);
|
||||
Assert.NotNull(vietnamese);
|
||||
|
||||
string[] keys =
|
||||
[
|
||||
"History_Undo", "Registry_ChangesHeader", "Registry_ChangeFormat", "Registry_NotSet", "Registry_NoChanges",
|
||||
];
|
||||
|
||||
foreach (var key in keys)
|
||||
{
|
||||
Assert.True(english!.GetString(key) is not null, $"Missing EN resource for key '{key}'.");
|
||||
Assert.True(vietnamese!.GetString(key) is not null, $"Missing VI resource for key '{key}'.");
|
||||
}
|
||||
AssertKeysExist(keys);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DashboardAndSearchUiKeys_ExistInResx_EN_and_VI()
|
||||
public void DashboardAndSearchUiKeys_ExistInResx_AllCultures()
|
||||
{
|
||||
var manager = new ResourceManager("CommandForge.Wpf.Resources.Strings", typeof(Strings).Assembly);
|
||||
var english = manager.GetResourceSet(CultureInfo.InvariantCulture, createIfNotExists: true, tryParents: true);
|
||||
var vietnamese = manager.GetResourceSet(new CultureInfo("vi"), createIfNotExists: true, tryParents: false);
|
||||
|
||||
Assert.NotNull(english);
|
||||
Assert.NotNull(vietnamese);
|
||||
|
||||
string[] keys =
|
||||
[
|
||||
"Search_Suggestion", "Home_Suggestions", "Maint_LowDisk", "Maint_HighUptime", "Maint_Open",
|
||||
];
|
||||
|
||||
foreach (var key in keys)
|
||||
{
|
||||
Assert.True(english!.GetString(key) is not null, $"Missing EN resource for key '{key}'.");
|
||||
Assert.True(vietnamese!.GetString(key) is not null, $"Missing VI resource for key '{key}'.");
|
||||
}
|
||||
AssertKeysExist(keys);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using CommandForge.Application.UserCommands;
|
||||
using CommandForge.Domain;
|
||||
|
||||
namespace CommandForge.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Tests the cmd argument normalization that fixes user commands hanging on an interactive
|
||||
/// cmd.exe (e.g. "cmd" + "ping google.com" must run as "cmd /c ping google.com").
|
||||
/// </summary>
|
||||
public sealed class UserCommandNormalizationTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("cmd", "ping google.com", "/c ping google.com")]
|
||||
[InlineData("cmd.exe", "dir", "/c dir")]
|
||||
[InlineData("CMD", "echo hi", "/c echo hi")]
|
||||
[InlineData("C:\\Windows\\System32\\cmd.exe", "whoami", "/c whoami")]
|
||||
[InlineData("cmd", "", "/c")]
|
||||
public void NormalizeArguments_PrependsSlashC_ForCmd(string exe, string args, string expected)
|
||||
=> Assert.Equal(expected, UserCommandFactory.NormalizeArguments(exe, args));
|
||||
|
||||
[Theory]
|
||||
[InlineData("cmd", "/c ping x")] // already has /c
|
||||
[InlineData("cmd", "/k keep open")] // explicit /k
|
||||
[InlineData("cmd", "/C UPPER")] // case-insensitive switch
|
||||
[InlineData("powershell", "ping x")] // not cmd — leave as-is (powershell runs it)
|
||||
[InlineData("ping", "google.com")] // direct executable
|
||||
public void NormalizeArguments_LeavesAsIs_WhenNotPlainCmd(string exe, string args)
|
||||
=> Assert.Equal(args, UserCommandFactory.NormalizeArguments(exe, args));
|
||||
|
||||
[Fact]
|
||||
public void ToDefinition_AppliesCmdNormalization()
|
||||
{
|
||||
var def = UserCommandFactory.ToDefinition(new UserCommand
|
||||
{
|
||||
Id = "x",
|
||||
Name = "n",
|
||||
Executable = "cmd",
|
||||
Arguments = "ping google.com",
|
||||
});
|
||||
|
||||
Assert.Equal("/c ping google.com", def.ArgsTemplate);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user