diff --git a/README.md b/README.md index 610af110..260c7f2b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Chris Titus Tech's Windows Utility -This Utility is a compilation of Windows tasks I perform on each Windows system I use. It is meant to streamline *installs*, debloat with *tweaks*, troubleshoot with *config*, and fix Windows *updates*. I am extremely picky about any contributions to keep this project clean and efficient. +This utility is a compilation of Windows tasks I perform on each Windows system I use. It is meant to streamline *installs*, debloat with *tweaks*, troubleshoot with *config*, and fix Windows *updates*. I am extremely picky about any contributions to keep this project clean and efficient. ![screen-install](screen-install.png) @@ -14,28 +14,30 @@ Launch Command: ``` iwr -useb https://christitus.com/win | iex ``` -Or shorter Thanks to [#144](/../../issues/144) +or by executing: ``` irm https://christitus.com/win | iex ``` +Courtesy of the issue raised at: [#144](/../../issues/144) + ### Issues: -- If you can't resolve christitus.com/win and getting errors launching India Region is BLOCKING raw github files and you need to VPN outside India. +- If you are unable to resolve christitus.com/win and are getting errors launching the tool, it might be due to India blocking GitHub's content domain and preventing downloads. You'll be required to use a VPN to tunnel out of India. Source: -- AntiVirus is also blocking the script. You can disable it temporarily to run the script. The script is flagged for malware because it runs under the administrator and makes system changes. +- Windows Security (formerly Defender) and other anti-virus software are known to block the script. The script gets flagged due to the fact that it requires administrator privileges & makes drastic system changes. -- If you are having TLS 1.2 Issues or You cannot find or resolve `christitus.com/win` then run with the following command: +- If you are having TLS 1.2 issues, or are having trouble resolving `christitus.com/win` then run with the following command: ``` [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12;iex(New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/ChrisTitusTech/winutil/main/winutil.ps1') ``` -If you are still having issues try changing your DNS provider to 1.1.1.1 or 8.8.8.8 +If you are still having issues try changing your DNS provider to 1.1.1.1 || 1.0.0.1 or 8.8.8.8 || 8.8.4.4 ## Support -- This project needs a ⭐️ from you. Don't forget to leave a star ⭐️. +- To morally and mentally support the project, make sure to leave a ⭐️! - EXE Wrapper for $10 @ https://www.cttstore.com/windows-toolbox ## Tutorial @@ -88,7 +90,7 @@ If you encounter any challenges or problems with the script, I kindly request th ## Contribute Code -To contribute a new code, please ensure that it is submitted to the **TEST BRANCH**. Please note that merges will not be performed directly on the MAIN branch. +To contribute new code, please ensure that it is submitted to the **TEST BRANCH**. Please note that merges will not be performed directly on the MAIN branch. When creating pull requests, it is essential to thoroughly document all changes made. This includes documenting any additions made to the tweaks section and ensuring that corresponding undo measures are in place to remove the newly added tweaks if necessary. Failure to adhere to this format may result in denial of the pull request. Additionally, comprehensive documentation is required for all code changes. Any code lacking sufficient documentation may also be denied. @@ -101,4 +103,4 @@ Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep roc ## GitHub Stats -![Alt](https://repobeats.axiom.co/api/embed/aad37eec9114c507f109d34ff8d38a59adc9503f.svg "Repobeats analytics image") \ No newline at end of file +![Alt](https://repobeats.axiom.co/api/embed/aad37eec9114c507f109d34ff8d38a59adc9503f.svg "Repobeats analytics image") diff --git a/config/applications.json b/config/applications.json index f329fb4a..3de94361 100755 --- a/config/applications.json +++ b/config/applications.json @@ -99,6 +99,10 @@ "winget": "Microsoft.DotNet.DesktopRuntime.7", "choco": "dotnet-7.0-runtime" }, + "WPFInstallduplicati": { + "winget": "Duplicati.Duplicati", + "choco": "duplicati" + }, "WPFInstalleaapp": { "winget": "ElectronicArts.EADesktop", "choco": "ea-app" @@ -267,6 +271,10 @@ "winget": "Joplin.Joplin", "choco": "joplin" }, + "WPFInstallkdeconnect": { + "winget": "KDE.KDEConnect", + "choco": "kdeconnect-kde" + }, "WPFInstallkdenlive": { "Winget": "KDE.Kdenlive", "choco": "kdenlive" @@ -399,6 +407,18 @@ "winget": "Open-Shell.Open-Shell-Menu", "choco": "open-shell" }, + "WPFInstallOpenVPN": { + "winget": "OpenVPNTechnologies.OpenVPNConnect", + "choco": "openvpn-connect" + }, + "WPFInstallOVirtualBox": { + "winget": "Oracle.VirtualBox", + "choco": "virtualbox" + }, + "WPFInstallPaintdotnet": { + "winget": "dotPDNLLC.paintdotnet", + "choco": "paint.net" + }, "WPFInstallpeazip": { "winget": "Giorgiotani.Peazip", "choco": "peazip" @@ -432,7 +452,7 @@ "choco": "putty" }, "WPFInstallpython3": { - "winget": "Python.Python.3.11", + "winget": "Python.Python.3.12", "choco": "python" }, "WPFInstallqbittorrent": { @@ -551,6 +571,10 @@ "winget": "9PF4KZ2VN4W9", "choco": "translucenttb" }, + "WPFInstallthunderbird": { + "winget": "Mozilla.Thunderbird", + "choco": "thunderbird" + }, "WPFInstalltwinkletray": { "Winget": "xanderfrangos.twinkletray", "choco": "na" diff --git a/config/preset.json b/config/preset.json index cc3ea429..d7dd7957 100644 --- a/config/preset.json +++ b/config/preset.json @@ -10,8 +10,7 @@ "WPFEssTweaksStorage", "WPFEssTweaksTele", "WPFEssTweaksWifi", - "WPFMiscTweaksPower", - "WPFMiscTweaksNum" + "WPFMiscTweaksPower" ], "laptop": [ "WPFEssTweaksAH", @@ -23,8 +22,7 @@ "WPFEssTweaksStorage", "WPFEssTweaksTele", "WPFEssTweaksWifi", - "WPFMiscTweaksLapPower", - "WPFMiscTweaksLapNum" + "WPFMiscTweaksLapPower" ], "minimal": [ "WPFEssTweaksHome", diff --git a/config/tweaks.json b/config/tweaks.json index 817bde10..60e19fd2 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -1909,17 +1909,6 @@ } ] }, - "WPFMiscTweaksExt": { - "registry": [ - { - "Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", - "Name": "HideFileExt", - "Type": "DWord", - "Value": "0", - "OriginalValue": "1" - } - ] - }, "WPFMiscTweaksUTC": { "registry": [ { @@ -2163,28 +2152,6 @@ " ] }, - "WPFMiscTweaksLapNum": { - "Registry": [ - { - "Path": "HKU:\\.DEFAULT\\Control Panel\\Keyboard", - "OriginalValue": "1", - "Name": "InitialKeyboardIndicators", - "Value": "0", - "Type": "DWord" - } - ] - }, - "WPFMiscTweaksNum": { - "Registry": [ - { - "Path": "HKU:\\.DEFAULT\\Control Panel\\Keyboard", - "OriginalValue": "1", - "Name": "InitialKeyboardIndicators", - "Value": "80000002", - "Type": "DWord" - } - ] - }, "WPFEssTweaksRemoveEdge": { "InvokeScript": [ " @@ -2327,67 +2294,6 @@ } ] }, - "WPFMiscTweaksDisableMouseAcceleration": { - "registry": [ - { - "Path": "HKCU:\\Control Panel\\Mouse", - "OriginalValue": "1", - "Name": "MouseSpeed", - "Value": "0", - "Type": "String" - }, - { - "Path": "HKCU:\\Control Panel\\Mouse", - "OriginalValue": "6", - "Name": "MouseThreshold1", - "Value": "0", - "Type": "String" - }, - { - "Path": "HKCU:\\Control Panel\\Mouse", - "OriginalValue": "10", - "Name": "MouseThreshold2", - "Value": "0", - "Type": "String" - } - ] - }, - "WPFMiscTweaksEnableMouseAcceleration": { - "registry": [ - { - "Path": "HKCU:\\Control Panel\\Mouse", - "OriginalValue": "1", - "Name": "MouseSpeed", - "Value": "1", - "Type": "String" - }, - { - "Path": "HKCU:\\Control Panel\\Mouse", - "OriginalValue": "6", - "Name": "MouseThreshold1", - "Value": "6", - "Type": "String" - }, - { - "Path": "HKCU:\\Control Panel\\Mouse", - "OriginalValue": "10", - "Name": "MouseThreshold2", - "Value": "10", - "Type": "String" - } - ] - }, - "WPFMiscTweaksEnableVerboselogon": { - "registry": [ - { - "Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\policies\\system", - "OriginalValue": "0", - "Name": "VerboseStatus", - "Value": "1", - "Type": "DWord" - } - ] - }, "WPFEssTweaksDeleteTempFiles": { "InvokeScript": [ "Get-ChildItem -Path \"C:\\Windows\\Temp\" *.* -Recurse | Remove-Item -Force -Recurse diff --git a/functions/private/Get-WinUtilToggleStatus.ps1 b/functions/private/Get-WinUtilToggleStatus.ps1 index 38d2d6e6..77b424b5 100644 --- a/functions/private/Get-WinUtilToggleStatus.ps1 +++ b/functions/private/Get-WinUtilToggleStatus.ps1 @@ -32,4 +32,43 @@ Function Get-WinUtilToggleStatus { return $true } } + if($ToggleSwitch -eq "WPFToggleNumLock"){ + $numlockvalue = (Get-ItemProperty -path 'HKCU:\Control Panel\Keyboard').InitialKeyboardIndicators + if($numlockvalue -eq 2){ + return $true + } + else{ + return $false + } + } + if($ToggleSwitch -eq "WPFToggleVerboseLogon"){ + $VerboseStatusvalue = (Get-ItemProperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System').VerboseStatus + if($VerboseStatusvalue -eq 1){ + return $true + } + else{ + return $false + } + } + if($ToggleSwitch -eq "WPFToggleShowExt"){ + $hideextvalue = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').HideFileExt + if($hideextvalue -eq 0){ + return $true + } + else{ + return $false + } + } + if($ToggleSwitch -eq "WPFToggleMouseAcceleration"){ + $MouseSpeed = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseSpeed + $MouseThreshold1 = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseThreshold1 + $MouseThreshold2 = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseThreshold2 + + if($MouseSpeed -eq 1 -and $MouseThreshold1 -eq 6 -and $MouseThreshold2 -eq 10){ + return $true + } + else{ + return $false + } + } } \ No newline at end of file diff --git a/functions/private/Invoke-WinUtilDarkMode.ps1 b/functions/private/Invoke-WinUtilDarkMode.ps1 index 52a917de..590da6eb 100644 --- a/functions/private/Invoke-WinUtilDarkMode.ps1 +++ b/functions/private/Invoke-WinUtilDarkMode.ps1 @@ -19,9 +19,9 @@ Function Invoke-WinUtilDarkMode { $DarkMoveValue = 1 } - $Theme = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" - Set-ItemProperty -Path $Theme -Name AppsUseLightTheme -Value $DarkMoveValue - Set-ItemProperty -Path $Theme -Name SystemUsesLightTheme -Value $DarkMoveValue + $Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" + Set-ItemProperty -Path $Path -Name AppsUseLightTheme -Value $DarkMoveValue + Set-ItemProperty -Path $Path -Name SystemUsesLightTheme -Value $DarkMoveValue } Catch [System.Security.SecurityException] { Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception" diff --git a/functions/private/Invoke-WinUtilMouseAcceleration.ps1 b/functions/private/Invoke-WinUtilMouseAcceleration.ps1 new file mode 100644 index 00000000..7dff10b1 --- /dev/null +++ b/functions/private/Invoke-WinUtilMouseAcceleration.ps1 @@ -0,0 +1,42 @@ +Function Invoke-WinUtilMouseAcceleration { + <# + + .SYNOPSIS + Enables/Disables Mouse Acceleration + + .PARAMETER DarkMoveEnabled + Indicates the current Mouse Acceleration State + + #> + Param($MouseAccelerationEnabled) + Try{ + if ($MouseAccelerationEnabled -eq $false){ + Write-Host "Enabling Mouse Acceleration" + $MouseSpeed = 1 + $MouseThreshold1 = 6 + $MouseThreshold2 = 10 + } + else { + Write-Host "Disabling Mouse Acceleration" + $MouseSpeed = 0 + $MouseThreshold1 = 0 + $MouseThreshold2 = 0 + + } + + $Path = "HKCU:\Control Panel\Mouse" + Set-ItemProperty -Path $Path -Name MouseSpeed -Value $MouseSpeed + Set-ItemProperty -Path $Path -Name MouseThreshold1 -Value $MouseThreshold1 + Set-ItemProperty -Path $Path -Name MouseThreshold2 -Value $MouseThreshold2 + } + Catch [System.Security.SecurityException] { + Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception" + } + Catch [System.Management.Automation.ItemNotFoundException] { + Write-Warning $psitem.Exception.ErrorRecord + } + Catch{ + Write-Warning "Unable to set $Name due to unhandled exception" + Write-Warning $psitem.Exception.StackTrace + } +} \ No newline at end of file diff --git a/functions/private/Invoke-WinUtilNumLock.ps1 b/functions/private/Invoke-WinUtilNumLock.ps1 new file mode 100644 index 00000000..9f62b22a --- /dev/null +++ b/functions/private/Invoke-WinUtilNumLock.ps1 @@ -0,0 +1,31 @@ +function Invoke-WinUtilNumLock { + <# + .SYNOPSIS + Disables/Enables NumLock on startup + .PARAMETER Enabled + Indicates whether to enable or disable Numlock on startup + #> + Param($Enabled) + Try{ + if ($Enabled -eq $false){ + Write-Host "Enabling Numlock on startup" + $value = 2 + } + else { + Write-Host "Disabling Numlock on startup" + $value = 0 + } + $Path = "HKCU:\Control Panel\Keyboard" + Set-ItemProperty -Path $Path -Name InitialKeyboardIndicators -Value $value + } + Catch [System.Security.SecurityException] { + Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception" + } + Catch [System.Management.Automation.ItemNotFoundException] { + Write-Warning $psitem.Exception.ErrorRecord + } + Catch{ + Write-Warning "Unable to set $Name due to unhandled exception" + Write-Warning $psitem.Exception.StackTrace + } +} \ No newline at end of file diff --git a/functions/private/Invoke-WinUtilShowExt.ps1 b/functions/private/Invoke-WinUtilShowExt.ps1 new file mode 100644 index 00000000..0b5dee6e --- /dev/null +++ b/functions/private/Invoke-WinUtilShowExt.ps1 @@ -0,0 +1,31 @@ +function Invoke-WinUtilShowExt { + <# + .SYNOPSIS + Disables/Enables Show file Extentions + .PARAMETER Enabled + Indicates whether to enable or disable Show file extentions + #> + Param($Enabled) + Try{ + if ($Enabled -eq $false){ + Write-Host "Showing file extentions" + $value = 0 + } + else { + Write-Host "hiding file extensions" + $value = 1 + } + $Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" + Set-ItemProperty -Path $Path -Name HideFileExt -Value $value + } + Catch [System.Security.SecurityException] { + Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception" + } + Catch [System.Management.Automation.ItemNotFoundException] { + Write-Warning $psitem.Exception.ErrorRecord + } + Catch{ + Write-Warning "Unable to set $Name due to unhandled exception" + Write-Warning $psitem.Exception.StackTrace + } +} \ No newline at end of file diff --git a/functions/private/Invoke-WinUtilVerboseLogon.ps1 b/functions/private/Invoke-WinUtilVerboseLogon.ps1 new file mode 100644 index 00000000..997050f9 --- /dev/null +++ b/functions/private/Invoke-WinUtilVerboseLogon.ps1 @@ -0,0 +1,31 @@ +function Invoke-WinUtilVerboseLogon { + <# + .SYNOPSIS + Disables/Enables VerboseLogon Messages + .PARAMETER Enabled + Indicates whether to enable or disable VerboseLogon messages + #> + Param($Enabled) + Try{ + if ($Enabled -eq $false){ + Write-Host "Enabling Verbose Logon Messages" + $value = 1 + } + else { + Write-Host "Disabling Verbose Logon Messages" + $value = 0 + } + $Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" + Set-ItemProperty -Path $Path -Name VerboseStatus -Value $value + } + Catch [System.Security.SecurityException] { + Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception" + } + Catch [System.Management.Automation.ItemNotFoundException] { + Write-Warning $psitem.Exception.ErrorRecord + } + Catch{ + Write-Warning "Unable to set $Name due to unhandled exception" + Write-Warning $psitem.Exception.StackTrace + } +} \ No newline at end of file diff --git a/functions/public/Invoke-WPFButton.ps1 b/functions/public/Invoke-WPFButton.ps1 index 01bb9fcd..d8579479 100644 --- a/functions/public/Invoke-WPFButton.ps1 +++ b/functions/public/Invoke-WPFButton.ps1 @@ -33,7 +33,6 @@ function Invoke-WPFButton { "WPFtweaksbutton" {Invoke-WPFtweaksbutton} "WPFAddUltPerf" {Invoke-WPFUltimatePerformance -State "Enabled"} "WPFRemoveUltPerf" {Invoke-WPFUltimatePerformance -State "Disabled"} - "WPFToggleDarkMode" {Invoke-WPFDarkMode -DarkMoveEnabled $(Get-WinUtilDarkMode)} "WPFundoall" {Invoke-WPFundoall} "WPFFeatureInstall" {Invoke-WPFFeatureInstall} "WPFPanelDISM" {Invoke-WPFPanelDISM} diff --git a/functions/public/Invoke-WPFShortcut.ps1 b/functions/public/Invoke-WPFShortcut.ps1 index 75c3155a..251ba7dd 100644 --- a/functions/public/Invoke-WPFShortcut.ps1 +++ b/functions/public/Invoke-WPFShortcut.ps1 @@ -12,7 +12,7 @@ function Invoke-WPFShortcut { Switch ($ShortcutToAdd) { "WinUtil" { - $SourceExe = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" + $SourceExe = "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe" $IRM = 'irm https://christitus.com/win | iex' $Powershell = '-ExecutionPolicy Bypass -Command "Start-Process powershell.exe -verb runas -ArgumentList' $ArgumentsToSourceExe = "$powershell '$IRM'" diff --git a/functions/public/Invoke-WPFToggle.ps1 b/functions/public/Invoke-WPFToggle.ps1 index 1ab6de6b..593a07b1 100644 --- a/functions/public/Invoke-WPFToggle.ps1 +++ b/functions/public/Invoke-WPFToggle.ps1 @@ -19,6 +19,9 @@ function Invoke-WPFToggle { "WPFToggleDarkMode" {Invoke-WinUtilDarkMode -DarkMoveEnabled $(Get-WinUtilToggleStatus WPFToggleDarkMode)} "WPFToggleBingSearch" {Invoke-WinUtilBingSearch $(Get-WinUtilToggleStatus WPFToggleBingSearch)} - + "WPFToggleNumLock" {Invoke-WinUtilNumLock $(Get-WinUtilToggleStatus WPFToggleNumLock)} + "WPFToggleVerboseLogon" {Invoke-WinUtilVerboseLogon $(Get-WinUtilToggleStatus WPFToggleVerboseLogon)} + "WPFToggleShowExt" {Invoke-WinUtilShowExt $(Get-WinUtilToggleStatus WPFToggleShowExt)} + "WPFToggleMouseAcceleration" {Invoke-WinUtilMouseAcceleration $(Get-WinUtilToggleStatus WPFToggleMouseAcceleration)} } } \ No newline at end of file diff --git a/gpedit-home.ps1 b/gpedit-home.ps1 index da841d33..a4931963 100644 --- a/gpedit-home.ps1 +++ b/gpedit-home.ps1 @@ -1,4 +1,4 @@ Get-ChildItem @( - "C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package*.mum", - "C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package*.mum" + "$env:SystemRoot\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package*.mum", + "$env:SystemRoot\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package*.mum" ) | ForEach-Object { dism.exe /online /norestart /add-package:"$_" } \ No newline at end of file diff --git a/screen-install.png b/screen-install.png index 75ecec6d..eef3c81c 100755 Binary files a/screen-install.png and b/screen-install.png differ diff --git a/winutil.ps1 b/winutil.ps1 index a0c0f105..9c89cfaa 100755 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -196,6 +196,45 @@ Function Get-WinUtilToggleStatus { return $true } } + if($ToggleSwitch -eq "WPFToggleNumLock"){ + $numlockvalue = (Get-ItemProperty -path 'HKCU:\Control Panel\Keyboard').InitialKeyboardIndicators + if($numlockvalue -eq 2){ + return $true + } + else{ + return $false + } + } + if($ToggleSwitch -eq "WPFToggleVerboseLogon"){ + $VerboseStatusvalue = (Get-ItemProperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System').VerboseStatus + if($VerboseStatusvalue -eq 1){ + return $true + } + else{ + return $false + } + } + if($ToggleSwitch -eq "WPFToggleShowExt"){ + $hideextvalue = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').HideFileExt + if($hideextvalue -eq 0){ + return $true + } + else{ + return $false + } + } + if($ToggleSwitch -eq "WPFToggleMouseAcceleration"){ + $MouseSpeed = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseSpeed + $MouseThreshold1 = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseThreshold1 + $MouseThreshold2 = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseThreshold2 + + if($MouseSpeed -eq 1 -and $MouseThreshold1 -eq 6 -and $MouseThreshold2 -eq 10){ + return $true + } + else{ + return $false + } + } } function Get-WinUtilVariables { @@ -504,9 +543,9 @@ Function Invoke-WinUtilDarkMode { $DarkMoveValue = 1 } - $Theme = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" - Set-ItemProperty -Path $Theme -Name AppsUseLightTheme -Value $DarkMoveValue - Set-ItemProperty -Path $Theme -Name SystemUsesLightTheme -Value $DarkMoveValue + $Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" + Set-ItemProperty -Path $Path -Name AppsUseLightTheme -Value $DarkMoveValue + Set-ItemProperty -Path $Path -Name SystemUsesLightTheme -Value $DarkMoveValue } Catch [System.Security.SecurityException] { Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception" @@ -572,6 +611,79 @@ function Invoke-WinUtilFeatureInstall { } } } +Function Invoke-WinUtilMouseAcceleration { + <# + + .SYNOPSIS + Enables/Disables Mouse Acceleration + + .PARAMETER DarkMoveEnabled + Indicates the current Mouse Acceleration State + + #> + Param($MouseAccelerationEnabled) + Try{ + if ($MouseAccelerationEnabled -eq $false){ + Write-Host "Enabling Mouse Acceleration" + $MouseSpeed = 1 + $MouseThreshold1 = 6 + $MouseThreshold2 = 10 + } + else { + Write-Host "Disabling Mouse Acceleration" + $MouseSpeed = 0 + $MouseThreshold1 = 0 + $MouseThreshold2 = 0 + + } + + $Path = "HKCU:\Control Panel\Mouse" + Set-ItemProperty -Path $Path -Name MouseSpeed -Value $MouseSpeed + Set-ItemProperty -Path $Path -Name MouseThreshold1 -Value $MouseThreshold1 + Set-ItemProperty -Path $Path -Name MouseThreshold2 -Value $MouseThreshold2 + } + Catch [System.Security.SecurityException] { + Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception" + } + Catch [System.Management.Automation.ItemNotFoundException] { + Write-Warning $psitem.Exception.ErrorRecord + } + Catch{ + Write-Warning "Unable to set $Name due to unhandled exception" + Write-Warning $psitem.Exception.StackTrace + } +} +function Invoke-WinUtilNumLock { + <# + .SYNOPSIS + Disables/Enables NumLock on startup + .PARAMETER Enabled + Indicates whether to enable or disable Numlock on startup + #> + Param($Enabled) + Try{ + if ($Enabled -eq $false){ + Write-Host "Enabling Numlock on startup" + $value = 2 + } + else { + Write-Host "Disabling Numlock on startup" + $value = 0 + } + $Path = "HKCU:\Control Panel\Keyboard" + Set-ItemProperty -Path $Path -Name InitialKeyboardIndicators -Value $value + } + Catch [System.Security.SecurityException] { + Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception" + } + Catch [System.Management.Automation.ItemNotFoundException] { + Write-Warning $psitem.Exception.ErrorRecord + } + Catch{ + Write-Warning "Unable to set $Name due to unhandled exception" + Write-Warning $psitem.Exception.StackTrace + } +} function Invoke-WinUtilScript { <# @@ -621,6 +733,37 @@ function Invoke-WinUtilScript { } } +function Invoke-WinUtilShowExt { + <# + .SYNOPSIS + Disables/Enables Show file Extentions + .PARAMETER Enabled + Indicates whether to enable or disable Show file extentions + #> + Param($Enabled) + Try{ + if ($Enabled -eq $false){ + Write-Host "Showing file extentions" + $value = 0 + } + else { + Write-Host "hiding file extensions" + $value = 1 + } + $Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" + Set-ItemProperty -Path $Path -Name HideFileExt -Value $value + } + Catch [System.Security.SecurityException] { + Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception" + } + Catch [System.Management.Automation.ItemNotFoundException] { + Write-Warning $psitem.Exception.ErrorRecord + } + Catch{ + Write-Warning "Unable to set $Name due to unhandled exception" + Write-Warning $psitem.Exception.StackTrace + } +} function Invoke-WinUtilTweaks { <# @@ -687,6 +830,37 @@ function Invoke-WinUtilTweaks { } } +function Invoke-WinUtilVerboseLogon { + <# + .SYNOPSIS + Disables/Enables VerboseLogon Messages + .PARAMETER Enabled + Indicates whether to enable or disable VerboseLogon messages + #> + Param($Enabled) + Try{ + if ($Enabled -eq $false){ + Write-Host "Enabling Verbose Logon Messages" + $value = 1 + } + else { + Write-Host "Disabling Verbose Logon Messages" + $value = 0 + } + $Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" + Set-ItemProperty -Path $Path -Name VerboseStatus -Value $value + } + Catch [System.Security.SecurityException] { + Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception" + } + Catch [System.Management.Automation.ItemNotFoundException] { + Write-Warning $psitem.Exception.ErrorRecord + } + Catch{ + Write-Warning "Unable to set $Name due to unhandled exception" + Write-Warning $psitem.Exception.StackTrace + } +} function Remove-WinUtilAPPX { <# @@ -1074,7 +1248,6 @@ function Invoke-WPFButton { "WPFtweaksbutton" {Invoke-WPFtweaksbutton} "WPFAddUltPerf" {Invoke-WPFUltimatePerformance -State "Enabled"} "WPFRemoveUltPerf" {Invoke-WPFUltimatePerformance -State "Disabled"} - "WPFToggleDarkMode" {Invoke-WPFDarkMode -DarkMoveEnabled $(Get-WinUtilDarkMode)} "WPFundoall" {Invoke-WPFundoall} "WPFFeatureInstall" {Invoke-WPFFeatureInstall} "WPFPanelDISM" {Invoke-WPFPanelDISM} @@ -1634,7 +1807,7 @@ function Invoke-WPFShortcut { Switch ($ShortcutToAdd) { "WinUtil" { - $SourceExe = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" + $SourceExe = "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe" $IRM = 'irm https://christitus.com/win | iex' $Powershell = '-ExecutionPolicy Bypass -Command "Start-Process powershell.exe -verb runas -ArgumentList' $ArgumentsToSourceExe = "$powershell '$IRM'" @@ -1704,7 +1877,10 @@ function Invoke-WPFToggle { "WPFToggleDarkMode" {Invoke-WinUtilDarkMode -DarkMoveEnabled $(Get-WinUtilToggleStatus WPFToggleDarkMode)} "WPFToggleBingSearch" {Invoke-WinUtilBingSearch $(Get-WinUtilToggleStatus WPFToggleBingSearch)} - + "WPFToggleNumLock" {Invoke-WinUtilNumLock $(Get-WinUtilToggleStatus WPFToggleNumLock)} + "WPFToggleVerboseLogon" {Invoke-WinUtilVerboseLogon $(Get-WinUtilToggleStatus WPFToggleVerboseLogon)} + "WPFToggleShowExt" {Invoke-WinUtilShowExt $(Get-WinUtilToggleStatus WPFToggleShowExt)} + "WPFToggleMouseAcceleration" {Invoke-WinUtilMouseAcceleration $(Get-WinUtilToggleStatus WPFToggleMouseAcceleration)} } } function Invoke-WPFtweaksbutton { @@ -2344,6 +2520,7 @@ $inputXML = ' + @@ -2425,6 +2602,105 @@ $inputXML = ' + + + + + @@ -2500,6 +2776,7 @@ $inputXML = ' + @@ -2595,6 +2872,7 @@ $inputXML = ' + @@ -2604,6 +2882,7 @@ $inputXML = ' + @@ -2622,6 +2901,7 @@ $inputXML = ' + @@ -2630,12 +2910,14 @@ $inputXML = ' + + @@ -2662,15 +2944,16 @@ $inputXML = ' - - + + + - +