From 64db5cc85b0709c83eae2b4841cdd8d86e88b74c Mon Sep 17 00:00:00 2001 From: Stephen Harris Date: Wed, 9 Aug 2023 15:23:15 +0100 Subject: [PATCH 01/16] Add Message confirming restore point created (#953) --- functions/private/Set-WinUtilRestorePoint.ps1 | 1 + winutil.ps1 | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/functions/private/Set-WinUtilRestorePoint.ps1 b/functions/private/Set-WinUtilRestorePoint.ps1 index 033132dc..20439e70 100644 --- a/functions/private/Set-WinUtilRestorePoint.ps1 +++ b/functions/private/Set-WinUtilRestorePoint.ps1 @@ -28,5 +28,6 @@ function Set-WinUtilRestorePoint { $description = "System Restore Point created by WinUtil" Checkpoint-Computer -Description $description -RestorePointType "MODIFY_SETTINGS" + Write-Host -ForegroundColor Green "System Restore Point Created Successfully" } } diff --git a/winutil.ps1 b/winutil.ps1 index bbaa7998..e089de5d 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -10,7 +10,7 @@ Author : Chris Titus @christitustech Runspace Author: @DeveloperDurp GitHub : https://github.com/ChrisTitusTech - Version : 23.08.08 + Version : 23.08.09 #> Start-Transcript $ENV:TEMP\Winutil.log -Append @@ -21,7 +21,7 @@ Add-Type -AssemblyName System.Windows.Forms # variable to sync between runspaces $sync = [Hashtable]::Synchronized(@{}) $sync.PSScriptRoot = $PSScriptRoot -$sync.version = "23.08.08" +$sync.version = "23.08.09" $sync.configs = @{} $sync.ProcessRunning = $false @@ -788,6 +788,7 @@ function Set-WinUtilRestorePoint { $description = "System Restore Point created by WinUtil" Checkpoint-Computer -Description $description -RestorePointType "MODIFY_SETTINGS" + Write-Host -ForegroundColor Green "System Restore Point Created Successfully" } } function Set-WinUtilScheduledTask { @@ -5854,7 +5855,7 @@ catch [System.Management.Automation.MethodInvocationException] { } } catch { - # If it broke some other way ???? + # If it broke some other way ?? Write-Host "Unable to load Windows.Markup.XamlReader. Double-check syntax and ensure .net is installed." } From dbec7b65018229834aec11e4382356e1386f5cc7 Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Wed, 9 Aug 2023 14:23:42 +0000 Subject: [PATCH 02/16] Compile Winutil --- winutil.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winutil.ps1 b/winutil.ps1 index e089de5d..84331faa 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -5855,7 +5855,7 @@ catch [System.Management.Automation.MethodInvocationException] { } } catch { - # If it broke some other way ?? + # If it broke some other way ???? Write-Host "Unable to load Windows.Markup.XamlReader. Double-check syntax and ensure .net is installed." } From 8dbc34353703c43e471ee6c1e4e7f12a04e4a657 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Wed, 9 Aug 2023 17:44:35 -0500 Subject: [PATCH 03/16] readme update --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 194a1bb1..a8f11673 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,9 @@ If you are having TLS 1.2 Issues or You cannot find or resolve `christitus.com/w If you are still having issues try changing your DNS provider to 1.1.1.1 or 8.8.8.8 -EXE Wrapper for $10 @ https://www.cttstore.com/windows-toolbox +## Support +- This project needs a ⭐️ from you. Don't forget to leave a star ⭐️. +- EXE Wrapper for $10 @ https://www.cttstore.com/windows-toolbox ## Overview @@ -84,6 +86,3 @@ Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep roc [![Contributors](https://contrib.rocks/image?repo=ChrisTitusTech/winutil)](https://github.com/ChrisTitusTech/winutil/graphs/contributors) -## Support -- This project needs a ⭐️ from you. Don't forget to leave a star ⭐️. -- EXE Wrapper for $10 @ https://www.cttstore.com/windows-toolbox From cf135eac7a4e7075dc73ec640189d90f0197440a Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Wed, 13 Sep 2023 11:15:59 -0500 Subject: [PATCH 04/16] music bee add #993 --- config/applications.json | 4 ++++ xaml/inputXML.xaml | 1 + 2 files changed, 5 insertions(+) diff --git a/config/applications.json b/config/applications.json index e3a720c8..23360d74 100644 --- a/config/applications.json +++ b/config/applications.json @@ -195,6 +195,10 @@ "winget": "mRemoteNG.mRemoteNG", "choco": "mremoteng" }, + "WPFInstallmusicbee": { + "winget": "MusicBee.MusicBee", + "choco": "musicbee" + }, "WPFInstallnodejs": { "winget": "OpenJS.NodeJS", "choco": "nodejs" diff --git a/xaml/inputXML.xaml b/xaml/inputXML.xaml index 611a5d7c..7b08498b 100644 --- a/xaml/inputXML.xaml +++ b/xaml/inputXML.xaml @@ -371,6 +371,7 @@ + From 350e5c91412033a286e96133475ee87d0f3e0774 Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Wed, 13 Sep 2023 16:16:29 +0000 Subject: [PATCH 05/16] Compile Winutil --- winutil.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/winutil.ps1 b/winutil.ps1 index 84331faa..7bab20ea 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -10,7 +10,7 @@ Author : Chris Titus @christitustech Runspace Author: @DeveloperDurp GitHub : https://github.com/ChrisTitusTech - Version : 23.08.09 + Version : 23.09.13 #> Start-Transcript $ENV:TEMP\Winutil.log -Append @@ -21,7 +21,7 @@ Add-Type -AssemblyName System.Windows.Forms # variable to sync between runspaces $sync = [Hashtable]::Synchronized(@{}) $sync.PSScriptRoot = $PSScriptRoot -$sync.version = "23.08.09" +$sync.version = "23.09.13" $sync.configs = @{} $sync.ProcessRunning = $false @@ -2450,6 +2450,7 @@ $inputXML = ' + @@ -2857,6 +2858,10 @@ $sync.configs.applications = '{ "winget": "mRemoteNG.mRemoteNG", "choco": "mremoteng" }, + "WPFInstallmusicbee": { + "winget": "MusicBee.MusicBee", + "choco": "musicbee" + }, "WPFInstallnodejs": { "winget": "OpenJS.NodeJS", "choco": "nodejs" From 42b532f4c7888d510381410cc7b05efe90d87096 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Wed, 13 Sep 2023 12:59:45 -0500 Subject: [PATCH 06/16] Cleanup Tweaks --- config/tweaks.json | 56 ---------- functions/private/Remove-OneDrive.ps1 | 85 +++++++++++++++ winutil.ps1 | 147 +++++++++++++++----------- xaml/inputXML.xaml | 4 - 4 files changed, 171 insertions(+), 121 deletions(-) create mode 100644 functions/private/Remove-OneDrive.ps1 diff --git a/config/tweaks.json b/config/tweaks.json index ab9dd6ee..f6dbac00 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -1885,42 +1885,6 @@ } ] }, - "WPFMiscTweaksLapPower": { - "registry": [ - { - "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Power\\PowerThrottling", - "Name": "PowerThrottlingOff", - "Type": "DWord", - "Value": "00000000", - "OriginalValue": "00000001" - }, - { - "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power", - "Name": "HiberbootEnabled", - "Type": "DWord", - "Value": "0000001", - "OriginalValue": "0000000" - } - ] - }, - "WPFMiscTweaksPower": { - "registry": [ - { - "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Power\\PowerThrottling", - "Name": "PowerThrottlingOff", - "Type": "DWord", - "Value": "00000001", - "OriginalValue": "00000000" - }, - { - "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power", - "Name": "HiberbootEnabled", - "Type": "DWord", - "Value": "0000000", - "OriginalValue": "00000001" - } - ] - }, "WPFMiscTweaksExt": { "registry": [ { @@ -2220,17 +2184,6 @@ " ] }, - "WPFMiscTweaksDisableTPMCheck": { - "registry": [ - { - "Path": "HKLM:\\SYSTEM\\Setup\\MoSetup", - "Name": "AllowUpgradesWithUnsupportedTPM", - "Type": "DWord", - "Value": "1", - "OriginalValue": "0" - } - ] - }, "WPFMiscTweaksDisableUAC": { "registry": [ { @@ -2309,15 +2262,6 @@ Get-ChildItem -Path $env:TEMP *.* -Recurse | Remove-Item -Force -Recurse" ] }, - "WPFEssTweaksRemoveCortana": { - "InvokeScript": [ - "Get-AppxPackage -allusers Microsoft.549981C3F5F10 | Remove-AppxPackage" - ], - "UndoScript": [ - "Get-AppxPackage -allusers | where Name -like \"Microsoft.549981C3F5F10\" | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"} - " - ] - }, "WPFEssTweaksDVR": { "registry": [ { diff --git a/functions/private/Remove-OneDrive.ps1 b/functions/private/Remove-OneDrive.ps1 new file mode 100644 index 00000000..12dc6715 --- /dev/null +++ b/functions/private/Remove-OneDrive.ps1 @@ -0,0 +1,85 @@ +function Remove-OneDrive { + <# + + .DESCRIPTION + This function will remove onedrive + + .EXAMPLE + + Remove-OneDrive + + #> + param ( + $name = "OneDrive" + ) + + Try{ + + Write-Output "Kill OneDrive process" + taskkill.exe /F /IM "OneDrive.exe" + taskkill.exe /F /IM "explorer.exe" + + Write-Output "Copy all OneDrive to Root UserProfile" + robocopy $env:USERPROFILE\OneDrive $env:USERPROFILE /e /xj + + Write-Output "Remove OneDrive" + if (Test-Path "$env:systemroot\System32\OneDriveSetup.exe") { + & "$env:systemroot\System32\OneDriveSetup.exe" /uninstall + } + if (Test-Path "$env:systemroot\SysWOW64\OneDriveSetup.exe") { + & "$env:systemroot\SysWOW64\OneDriveSetup.exe" /uninstall + } + + Write-Output "Removing OneDrive leftovers" + Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:localappdata\Microsoft\OneDrive" + Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:programdata\Microsoft OneDrive" + Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:systemdrive\OneDriveTemp" + # check if directory is empty before removing: + If ((Get-ChildItem "$env:userprofile\OneDrive" -Recurse | Measure-Object).Count -eq 0) { + Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:userprofile\OneDrive" + } + + Write-Output "Disable OneDrive via Group Policies" + New-FolderForced -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" + Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" "DisableFileSyncNGSC" 1 + + Write-Output "Remove Onedrive from explorer sidebar" + New-PSDrive -PSProvider "Registry" -Root "HKEY_CLASSES_ROOT" -Name "HKCR" + mkdir -Force "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" + Set-ItemProperty -Path "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0 + mkdir -Force "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" + Set-ItemProperty -Path "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0 + Remove-PSDrive "HKCR" + + # Thank you Matthew Israelsson + Write-Output "Removing run hook for new users" + reg load "hku\Default" "C:\Users\Default\NTUSER.DAT" + reg delete "HKEY_USERS\Default\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "OneDriveSetup" /f + reg unload "hku\Default" + + Write-Output "Removing startmenu entry" + Remove-Item -Force -ErrorAction SilentlyContinue "$env:userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" + + Write-Output "Removing scheduled task" + Get-ScheduledTask -TaskPath '\' -TaskName 'OneDrive*' -ea SilentlyContinue | Unregister-ScheduledTask -Confirm:$false + + Write-Output "Restarting explorer" + Start-Process "explorer.exe" + + Write-Output "Waiting for explorer to complete loading" + Start-Sleep 10 + } + Catch [System.Exception] { + if($psitem.Exception.Message -like "*The requested operation requires elevation*"){ + Write-Warning "Unable to uninstall $name due to a Security Exception" + } + Else{ + Write-Warning "Unable to uninstall $name due to unhandled exception" + Write-Warning $psitem.Exception.StackTrace + } + } + Catch{ + Write-Warning "Unable to uninstall $name due to unhandled exception" + Write-Warning $psitem.Exception.StackTrace + } +} \ No newline at end of file diff --git a/winutil.ps1 b/winutil.ps1 index 7bab20ea..61cb8526 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -652,6 +652,91 @@ function Invoke-WinUtilTweaks { } } +function Remove-OneDrive { + <# + + .DESCRIPTION + This function will remove onedrive + + .EXAMPLE + + Remove-OneDrive + + #> + param ( + $name = "OneDrive" + ) + + Try{ + + Write-Output "Kill OneDrive process" + taskkill.exe /F /IM "OneDrive.exe" + taskkill.exe /F /IM "explorer.exe" + + Write-Output "Copy all OneDrive to Root UserProfile" + robocopy $env:USERPROFILE\OneDrive $env:USERPROFILE /e /xj + + Write-Output "Remove OneDrive" + if (Test-Path "$env:systemroot\System32\OneDriveSetup.exe") { + & "$env:systemroot\System32\OneDriveSetup.exe" /uninstall + } + if (Test-Path "$env:systemroot\SysWOW64\OneDriveSetup.exe") { + & "$env:systemroot\SysWOW64\OneDriveSetup.exe" /uninstall + } + + Write-Output "Removing OneDrive leftovers" + Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:localappdata\Microsoft\OneDrive" + Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:programdata\Microsoft OneDrive" + Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:systemdrive\OneDriveTemp" + # check if directory is empty before removing: + If ((Get-ChildItem "$env:userprofile\OneDrive" -Recurse | Measure-Object).Count -eq 0) { + Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:userprofile\OneDrive" + } + + Write-Output "Disable OneDrive via Group Policies" + New-FolderForced -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" + Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" "DisableFileSyncNGSC" 1 + + Write-Output "Remove Onedrive from explorer sidebar" + New-PSDrive -PSProvider "Registry" -Root "HKEY_CLASSES_ROOT" -Name "HKCR" + mkdir -Force "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" + Set-ItemProperty -Path "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0 + mkdir -Force "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" + Set-ItemProperty -Path "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0 + Remove-PSDrive "HKCR" + + # Thank you Matthew Israelsson + Write-Output "Removing run hook for new users" + reg load "hku\Default" "C:\Users\Default\NTUSER.DAT" + reg delete "HKEY_USERS\Default\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "OneDriveSetup" /f + reg unload "hku\Default" + + Write-Output "Removing startmenu entry" + Remove-Item -Force -ErrorAction SilentlyContinue "$env:userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" + + Write-Output "Removing scheduled task" + Get-ScheduledTask -TaskPath '\' -TaskName 'OneDrive*' -ea SilentlyContinue | Unregister-ScheduledTask -Confirm:$false + + Write-Output "Restarting explorer" + Start-Process "explorer.exe" + + Write-Output "Waiting for explorer to complete loading" + Start-Sleep 10 + } + Catch [System.Exception] { + if($psitem.Exception.Message -like "*The requested operation requires elevation*"){ + Write-Warning "Unable to uninstall $name due to a Security Exception" + } + Else{ + Write-Warning "Unable to uninstall $name due to unhandled exception" + Write-Warning $psitem.Exception.StackTrace + } + } + Catch{ + Write-Warning "Unable to uninstall $name due to unhandled exception" + Write-Warning $psitem.Exception.StackTrace + } +} function Remove-WinUtilAPPX { <# @@ -2565,8 +2650,6 @@ $inputXML = '