Skip to content

Commit

Permalink
Add option to turn on/off Family Safety Features from Task Schedules (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
LeDragoX committed Oct 11, 2023
1 parent 12db49b commit 9f50a10
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
18 changes: 16 additions & 2 deletions WinDebloatTools.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ function Show-GUI() {
$CbWindowsMediaPlayer = New-CheckBox -Text "Windows Media Player" -Width $LayoutT1.PanelElementWidth -Height $LayoutT1.CheckBoxHeight -LocationX $LayoutT1.PanelElementX -FontSize $LayoutT1.Heading[3] -ElementBefore $CbPrintingXPSServices
$CbWindowsSandbox = New-CheckBox -Text "Windows Sandbox" -Width $LayoutT1.PanelElementWidth -Height $LayoutT1.CheckBoxHeight -LocationX $LayoutT1.PanelElementX -FontSize $LayoutT1.Heading[3] -ElementBefore $CbWindowsMediaPlayer

$ClWindowsCapabilities = New-Label -Text "Windows Capabilities" -Width $LayoutT1.PanelElementWidth -Height $LayoutT1.CaptionLabelHeight -LocationX 0 -FontSize $LayoutT1.Heading[2] -FontStyle 'Bold' -ElementBefore $CbWindowsSandbox
$ClTaskScheduler = New-Label -Text "Task Scheduler" -Width $LayoutT1.PanelElementWidth -Height $LayoutT1.CaptionLabelHeight -LocationX 0 -FontSize $LayoutT1.Heading[2] -FontStyle 'Bold' -ElementBefore $CbWindowsSandbox
$CbFamilySafety = New-CheckBox -Text "Family Safety Features" -Width $LayoutT1.PanelElementWidth -Height $LayoutT1.CheckBoxHeight -LocationX $LayoutT1.PanelElementX -FontSize $LayoutT1.Heading[3] -ElementBefore $ClTaskScheduler

$ClWindowsCapabilities = New-Label -Text "Windows Capabilities" -Width $LayoutT1.PanelElementWidth -Height $LayoutT1.CaptionLabelHeight -LocationX 0 -FontSize $LayoutT1.Heading[2] -FontStyle 'Bold' -ElementBefore $CbFamilySafety
$CbPowerShellISE = New-CheckBox -Text "PowerShell ISE" -Width $LayoutT1.PanelElementWidth -Height $LayoutT1.CheckBoxHeight -LocationX $LayoutT1.PanelElementX -FontSize $LayoutT1.Heading[3] -ElementBefore $ClWindowsCapabilities

$ClMiscFeatures = New-Label -Text "Miscellaneous Features" -Width $LayoutT1.PanelElementWidth -Height $LayoutT1.CaptionLabelHeight -LocationX 0 -FontSize $LayoutT1.Heading[2] -FontStyle 'Bold' -ElementBefore $CbPowerShellISE
Expand Down Expand Up @@ -458,6 +461,7 @@ function Show-GUI() {
$T1Panel2.Controls.AddRange(@($ClOtherTools, $RandomizeSystemColor, $ReinstallBloatApps, $RepairWindows, $ShowDebloatInfo))
$T1Panel3.Controls.AddRange(@($ClWindowsUpdate, $CbAutomaticWindowsUpdate))
$T1Panel3.Controls.AddRange(@($ClOptionalFeatures, $CbHyperV, $CbInternetExplorer, $CbPrintToPDFServices, $CbPrintingXPSServices, $CbWindowsMediaPlayer, $CbWindowsSandbox))
$T1Panel3.Controls.AddRange(@($ClTaskScheduler, $CbFamilySafety))
$T1Panel3.Controls.AddRange(@($ClWindowsCapabilities, $CbPowerShellISE))
$T1Panel3.Controls.AddRange(@($ClMiscFeatures, $CbEncryptedDNS, $CbGodMode, $CbMouseAcceleration, $CbMouseNaturalScroll, $CbTakeOwnership, $CbFastShutdownPCShortcut))

Expand Down Expand Up @@ -825,6 +829,16 @@ function Show-GUI() {
}
})

$CbFamilySafety.Add_Click( {
If ($CbFamilySafety.CheckState -eq "Checked") {
Enable-FamilySafety
$CbFamilySafety.Text = "[ON] Family Safety Features *"
} Else {
Disable-FamilySafety
$CbFamilySafety.Text = "[OFF] Family Safety Features"
}
})

$CbPowerShellISE.Add_Click( {
If ($CbPowerShellISE.CheckState -eq "Checked") {
Enable-PowerShellISE
Expand Down Expand Up @@ -855,7 +869,7 @@ function Show-GUI() {
}
})

$CbMouseAcceleration.Add_Click( {
$CbMouseAcceleration.Add_Click( {
If ($CbMouseAcceleration.CheckState -eq "Checked") {
Enable-MouseAcceleration
$CbMouseAcceleration.Text = "[ON] Mouse Acceleration *"
Expand Down
17 changes: 17 additions & 0 deletions src/utils/Individual-Tweaks.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Import-Module -DisableNameChecking "$PSScriptRoot\..\lib\debloat-helper\Remove-I
Import-Module -DisableNameChecking "$PSScriptRoot\..\lib\debloat-helper\Set-CapabilityState.psm1"
Import-Module -DisableNameChecking "$PSScriptRoot\..\lib\debloat-helper\Set-ItemPropertyVerified.psm1"
Import-Module -DisableNameChecking "$PSScriptRoot\..\lib\debloat-helper\Set-OptionalFeatureState.psm1"
Import-Module -DisableNameChecking "$PSScriptRoot\..\lib\debloat-helper\Set-ScheduledTaskState.psm1"
Import-Module -DisableNameChecking "$PSScriptRoot\..\lib\debloat-helper\Set-ServiceStartup.psm1"
Import-Module -DisableNameChecking "$PSScriptRoot\..\lib\package-managers\Manage-Software.psm1"

Expand Down Expand Up @@ -146,6 +147,22 @@ function Enable-EncryptedDNS() {
Set-DNSClientServerAddress -InterfaceAlias "Wi-Fi*" -ServerAddresses ("1.1.1.1", "8.8.8.8", "2606:4700:4700::1111", "2001:4860:4860::8888")
}

function Disable-FamilySafety() {
Set-ScheduledTaskState -State 'Disabled' -ScheduledTask @(
"\Microsoft\Windows\Shell\FamilySafetyMonitor",
"\Microsoft\Windows\Shell\FamilySafetyRefreshTask",
"\Microsoft\Windows\Shell\FamilySafetyUpload"
)
}

function Enable-FamilySafety() {
Set-ScheduledTaskState -State 'Enabled' -ScheduledTask @(
"\Microsoft\Windows\Shell\FamilySafetyMonitor",
"\Microsoft\Windows\Shell\FamilySafetyRefreshTask",
"\Microsoft\Windows\Shell\FamilySafetyUpload"
)
}

function Disable-FastShutdownShortcut() {
Write-Status -Types "*" -Status "Removing the shortcut to shutdown the computer on the Desktop..." -Warning
Remove-ItemVerified -Path "$DesktopPath\Fast Shutdown.lnk"
Expand Down

0 comments on commit 9f50a10

Please sign in to comment.