diff --git a/StackMonkey-test.ps1 b/StackMonkey-test.ps1 index 0368b2a..14a05ed 100644 --- a/StackMonkey-test.ps1 +++ b/StackMonkey-test.ps1 @@ -41,130 +41,17 @@ $Global:Tasks = @( # On-Boarding, right column (optional bits) @{ Id='enableBitLocker'; Name='EnableBitLocker'; Label='Enable BitLocker'; HandlerFn='Set-SVSBitLocker'; Page='onboard'; Column='right' }, - # @{ Id='setEdgeDefaultSearch';Name='setedgedefaultsearch';Label='Set Edge Default Search'; Tooltip='Will configure Edge to use Google as default search provider'; HandlerFn='set-EdgeDefaultSearchProvider';Page='onboard'; Column='right' }, + @{ Id='setEdgeDefaultSearch';Name='setedgedefaultsearch';Label='Set Edge Default Search'; Tooltip='Will configure Edge to use Google as default search provider'; HandlerFn='set-EdgeDefaultSearchProvider';Page='onboard'; Column='right' }, # Off-Boarding @{ Id='uninstallCyberQP'; Name='uninstallCyberQP'; Label='Uninstall CyberQP'; HandlerFn='Uninstall-CyberQP'; Page='offboard' }, @{ Id='uninstallSVSMSPModule'; Name='uninstallSVSMSPModule'; Label='Uninstall SVSMSP Module'; HandlerFn='Cleanup-SVSMSP'; Page='offboard' }, - # ───────────────────────────────────────────────────────────────────────────── - # Tweaks: one entry per PS1 file, with hidden
of radio‐buttons for params - # ───────────────────────────────────────────────────────────────────────────── - - @{ - Id = 'setEdgeDefaultSearch'; - Name = 'setEdgeDefaultSearch'; - Label = 'Set Edge Default Search'; - Tooltip = 'Choose which search engine Edge should use (or Reset to defaults)'; - HandlerFn = 'Handle-SetEdgeDefaultSearch'; - Page = 'tweaks'; - Column = ''; - SubOptions = @( - @{ - ParamName = 'SearchProviderName'; - Type = 'radio'; - Options = @('Google', 'Bing', 'DuckDuckGo'); - Default = 'Google' - }, - @{ - ParamName = 'Reset'; - Type = 'radio'; - Options = @('No', 'Yes'); - Default = 'No' - } - ) - }, - - @{ - Id = 'setTextEditor'; - Name = 'setTextEditor'; - Label = 'Set Default Text Editor'; - Tooltip = 'Pick your preferred default text editor for .txt and .ps1 files.'; - HandlerFn = 'Handle-SetTextEditor'; - Page = 'tweaks'; - Column = ''; - SubOptions = @( - @{ - ParamName = 'Editor'; - Type = 'radio'; - Options = @('Notepad', 'Notepad++', 'VSCode'); - Default = 'Notepad' - } - ) - }, - - @{ - Id = 'setWindowsPerformance'; - Name = 'setWindowsPerformance'; - Label = 'Optimize Windows Performance'; - Tooltip = 'Choose performance mode or restore defaults.'; - HandlerFn = 'Handle-SetWindowsPerformance'; - Page = 'tweaks'; - Column = ''; - SubOptions = @( - @{ - ParamName = 'Mode'; - Type = 'radio'; - Options = @('Gaming', 'Balanced', 'PowerSaver'); - Default = 'Balanced' - }, - @{ - ParamName = 'RestoreDefaults'; - Type = 'radio'; - Options = @('No', 'Yes'); - Default = 'No' - } - ) - }, - - @{ - Id = 'stopUnnecessaryServices'; - Name = 'stopUnnecessaryServices'; - Label = 'Stop Unnecessary Services'; - Tooltip = 'Log actions to file or just run silently.'; - HandlerFn = 'Handle-StopUnnecessaryServices'; - Page = 'tweaks'; - Column = ''; - SubOptions = @( - @{ - ParamName = 'LogFilePathChoice'; - Type = 'radio'; - Options = @('NoLogging', 'DefaultPath', 'CustomPath'); - Default = 'NoLogging' - } - # If you want to allow a “custom path” text‐box, you can detect when "CustomPath" is selected - # on the front‐end and show an . (See note below.) - ) - }, - - @{ - Id = 'setBrowserPwdPolicy'; - Name = 'setBrowserPwdPolicy'; - Label = 'Enforce Browser Password Policy'; - Tooltip = 'Enable or disable saving passwords and set expiration days.'; - HandlerFn = 'Handle-SetBrowserPwdPolicy'; - Page = 'tweaks'; - Column = ''; - SubOptions = @( - @{ - ParamName = 'DisableSavePasswords'; - Type = 'radio'; - Options = @('No', 'Yes'); - Default = 'No' - }, - @{ - ParamName = 'PasswordExpirationDays'; - Type = 'radio'; - Options = @('30', '60', '90', 'Never'); - Default = '90' - } - ) - }, - + # Tweaks + @{ Id='disableAnimations'; Name='disableAnimations'; Label='Disable Animations'; HandlerFn='Disable-Animations'; Page='tweaks' }, # SVS Apps @{ Id='wingetLastpass'; Name='wingetLastpass'; Label='LastPass Desktop App'; HandlerFn='Install-WingetLastPass'; Page='SVSApps' } - ) #endregion @@ -613,52 +500,6 @@ function Handle-InstallDattoRMM { } -#-------------------------------------------------------------------------- - # Handle function for the Tweaks tab - #-------------------------------------------------------------------------- - - -function Handle-SetEdgeDefaultSearch { -param($Context) - -# Read which radio was chosen: -# You’ll receive a GET or POST? In the existing pattern, “tweaks” is GET‐only, -# so you can’t get the radio values over GET. You’ll probably want to change -# those “fetch(t.handler, { method: 'GET' })” calls in JS to send a POST -# with JSON containing all the checked‐plus‐radio values. - -# Here’s a simple stub: -Write-LogHybrid "Handle-SetEdgeDefaultSearch called" "Info" "Tweaks" - -# Response back: -Respond-Text $Context "Applied SetEdgeDefaultSearch with whatever was selected." -} - -function Handle-SetTextEditor { - param($Context) - Write-LogHybrid "Handle-SetTextEditor called" "Info" "Tweaks" - Respond-Text $Context "Text editor preference applied." -} - -function Handle-SetWindowsPerformance { - param($Context) - Write-LogHybrid "Handle-SetWindowsPerformance called" "Info" "Tweaks" - Respond-Text $Context "WindowsPerformance tweak applied." -} - -function Handle-StopUnnecessaryServices { - param($Context) - Write-LogHybrid "Handle-StopUnnecessaryServices called" "Info" "Tweaks" - Respond-Text $Context "Stop-UnnecessaryServices tweak applied." -} - -function Handle-SetBrowserPwdPolicy { - param($Context) - Write-LogHybrid "Handle-SetBrowserPwdPolicy called" "Info" "Tweaks" - Respond-Text $Context "Browser password policy tweak applied." -} - - # Off-boarding handlers function Handle-UninstallCyberQP { param($Context) @@ -695,93 +536,45 @@ function Install-WingetLastPass { #region UI Generation function Build-Checkboxes { - param( - [string] $Page, - [string] $Column - ) + param($Page, $Column) - # For each task in the given Page & Column, build a
- +

Off-Boarding