From 9e74721e9206cf9a2bc61c336a0dcb0c3bbff5e8 Mon Sep 17 00:00:00 2001 From: Belim Date: Mon, 26 May 2025 11:17:11 +0200 Subject: [PATCH] Add Demo Plugin Pack [1.6 of CrapFixer] Demonstrates all currently supported features of the plugin system --- plugins/Demo Plugin Pack.ps1 | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 plugins/Demo Plugin Pack.ps1 diff --git a/plugins/Demo Plugin Pack.ps1 b/plugins/Demo Plugin Pack.ps1 new file mode 100644 index 0000000..03c5114 --- /dev/null +++ b/plugins/Demo Plugin Pack.ps1 @@ -0,0 +1,36 @@ +๏ปฟ# ================================================================================ +# ๐Ÿงช Demo Plugin Pack +# Demonstrates all currently supported features of the plugin system +# ================================================================================ +# โœ… Features demonstrated: +# - Metadata section: [Plugin] with Info +# - Multiple commands: [Commands] with Check / Do / Undo definitions +# - Value validation: [Expect] to define expected output values from commands +# - Multi-line registry checks, including multiple keys +# - Optional command output logging (e.g., `whoami`) +# - Optional script logic (executed like a normal PowerShell script) +# +# ๐Ÿ’ก Usage notes: +# - The Check command is executed first; its output is parsed against [Expect] +# - The Do command is run when fixing is triggered +# - The Undo command attempts to revert changes +# - Output from all commands is logged, and key-value validation is shown +# - Keys not listed under [Expect] are ignored in validation +# +# ๐Ÿ“ File name: DemoPluginPack.ps1 +# ================================================================================= + +[Commands] +Info=Demonstrates all available plugin features including Registry, System, and File operations +Check=reg query HKLM\Software\Policies\Microsoft\Windows\DataCollection /v AllowTelemetry && reg query HKCU\Software\Microsoft\Windows\CurrentVersion\Search /v BingSearchEnabled && whoami +Do=reg add HKLM\Software\Policies\Microsoft\Windows\DataCollection /v AllowTelemetry /t REG_DWORD /d 0 /f && reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Search /v BingSearchEnabled /t REG_DWORD /d 0 /f && echo Fixes applied +Undo=reg add HKLM\Software\Policies\Microsoft\Windows\DataCollection /v AllowTelemetry /t REG_DWORD /d 1 /f && reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Search /v BingSearchEnabled /t REG_DWORD /d 1 /f && echo Reverted + +[Expect] +AllowTelemetry=0x0 +BingSearchEnabled=0x0 +# whoami output is not validated โ€“ only logged + +# Optional script body โ€“ this executes if the script is run directly +Write-Host "This is the demo plugin pack. Logic can be placed here if needed." +