diff --git a/README.md b/README.md index 112794b5..b3ef0aa9 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If you have Issues, refer to [Known Issues](https://christitustech.github.io/win These are the sponsors that help keep this project alive with monthly contributions. -Yusuke SaitoTriHyderaMark AmosJason A. DiegmuellerwyattRMSStefanPaulDave JonesAnthony MendezxPandakuClaudemodsTimothy CookMaxDursleyGuySandman616 +Yusuke SaitoTriHyderaMark AmosJason A. DiegmuellerwyattRMSStefanPaulDave JonesAnthony MendezxPandakuClaudemodsMaxDursleyGuySandman616Phillip Waters ## 🏅 Thanks to all Contributors Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻. diff --git a/config/tweaks.json b/config/tweaks.json index 2a6bf95e..93ed630c 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -3464,14 +3464,5 @@ "Type": "Button", "ButtonWidth": "300", "link": "https://christitustech.github.io/winutil/dev/tweaks/Performance-Plans/RemoveUltPerf" - }, - "WPFWinUtilShortcut": { - "Content": "Create WinUtil Shortcut", - "category": "Shortcuts", - "panel": "2", - "Order": "a082_", - "Type": "Button", - "ButtonWidth": "300", - "link": "https://christitustech.github.io/winutil/dev/tweaks/Shortcuts/Shortcut" } } diff --git a/docs/dev/tweaks/Essential-Tweaks/DisableRecall.md b/docs/dev/tweaks/Essential-Tweaks/DisableRecall.md index 6635a7dc..a6ceaa73 100644 --- a/docs/dev/tweaks/Essential-Tweaks/DisableRecall.md +++ b/docs/dev/tweaks/Essential-Tweaks/DisableRecall.md @@ -36,7 +36,7 @@ Disables MS Recall built into Windows since 24H2. "InvokeScript": [ " Write-Host \"Disable Recall\" - DISM /Online /Disable-Feature /FeatureName:Recall + DISM /Online /Disable-Feature /FeatureName:Recall " ], "UndoScript": [ @@ -45,7 +45,7 @@ Disables MS Recall built into Windows since 24H2. DISM /Online /Enable-Feature /FeatureName:Recall " ], - "link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/DisableRecall" + "link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/DisableRecall" }, ``` @@ -56,7 +56,7 @@ Disables MS Recall built into Windows since 24H2. ```powershell Write-Host "Disable Recall" - DISM /Online /Disable-Feature /FeatureName:Recall + DISM /Online /Disable-Feature /FeatureName:Recall ``` diff --git a/docs/dev/tweaks/Shortcuts/Shortcut.md b/docs/dev/tweaks/Shortcuts/Shortcut.md deleted file mode 100644 index c980269e..00000000 --- a/docs/dev/tweaks/Shortcuts/Shortcut.md +++ /dev/null @@ -1,113 +0,0 @@ -# Create WinUtil Shortcut - -Last Updated: 2024-08-07 - - -!!! info - The Development Documentation is auto generated for every compilation of WinUtil, meaning a part of it will always stay up-to-date. **Developers do have the ability to add custom content, which won't be updated automatically.** - - - - - - -
-Preview Code - -```json -{ - "Content": "Create WinUtil Shortcut", - "category": "Shortcuts", - "panel": "2", - "Order": "a082_", - "Type": "Button", - "ButtonWidth": "300", - "link": "https://christitustech.github.io/winutil/dev/tweaks/Shortcuts/Shortcut" -} -``` - -
- -## Function: Invoke-WPFShortcut - -```powershell -function Invoke-WPFShortcut { - <# - - .SYNOPSIS - Creates a shortcut and prompts for a save location - - .PARAMETER ShortcutToAdd - The name of the shortcut to add - - .PARAMETER RunAsAdmin - A boolean value to make 'Run as administrator' property on (true) or off (false), defaults to off - - #> - param( - $ShortcutToAdd, - [bool]$RunAsAdmin = $false - ) - - # Preper the Shortcut Fields and add an a Custom Icon if it's available, else don't add a Custom Icon. - - Switch ($ShortcutToAdd) { - "WinUtil" { - # Use Powershell 7 if installed and fallback to PS5 if not - if (Get-Command "pwsh" -ErrorAction SilentlyContinue) { - $shell = "pwsh.exe" - } else { - $shell = "powershell.exe" - } - - $shellArgs = "-ExecutionPolicy Bypass -Command `"Start-Process $shell -verb runas -ArgumentList `'-Command `"irm https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1 | iex`"`'" - - $DestinationName = "WinUtil.lnk" - } - } - - # Show a File Dialog Browser, to let the User choose the Name and Location of where to save the Shortcut - $FileBrowser = New-Object System.Windows.Forms.SaveFileDialog - $FileBrowser.InitialDirectory = [Environment]::GetFolderPath('Desktop') - $FileBrowser.Filter = "Shortcut Files (*.lnk)|*.lnk" - $FileBrowser.FileName = $DestinationName - - # Do an Early Return if the Save Operation was canceled by User's Input. - $FileBrowserResult = $FileBrowser.ShowDialog() - $DialogResultEnum = New-Object System.Windows.Forms.DialogResult - if (-not ($FileBrowserResult -eq $DialogResultEnum::OK)) { - return - } - - # Prepare the Shortcut paramter - $WshShell = New-Object -comObject WScript.Shell - $Shortcut = $WshShell.CreateShortcut($FileBrowser.FileName) - $Shortcut.TargetPath = $shell - $Shortcut.Arguments = $shellArgs - if (Test-Path -Path $winutildir["logo.ico"]) { - $shortcut.IconLocation = $winutildir["logo.ico"] - } - - # Save the Shortcut to disk - $Shortcut.Save() - - if ($RunAsAdmin -eq $true) { - $bytes = [System.IO.File]::ReadAllBytes($FileBrowser.FileName) - # Set byte value at position 0x15 in hex, or 21 in decimal, from the value 0x00 to 0x20 in hex - $bytes[0x15] = $bytes[0x15] -bor 0x20 - [System.IO.File]::WriteAllBytes($FileBrowser.FileName, $bytes) - } - - Write-Host "Shortcut for $ShortcutToAdd has been saved to $($FileBrowser.FileName) with 'Run as administrator' set to $RunAsAdmin" -} - -``` - - - - - - - -[View the JSON file](https://github.com/ChrisTitusTech/winutil/tree/main/config/tweaks.json) - diff --git a/functions/microwin/Microwin-NewFirstRun.ps1 b/functions/microwin/Microwin-NewFirstRun.ps1 index bb2deb6d..614df6bc 100644 --- a/functions/microwin/Microwin-NewFirstRun.ps1 +++ b/functions/microwin/Microwin-NewFirstRun.ps1 @@ -52,41 +52,6 @@ function Microwin-NewFirstRun { Remove-Item -Path "$env:USERPROFILE\Desktop\*.lnk" Remove-Item -Path "$env:HOMEDRIVE\Users\Default\Desktop\*.lnk" - # ************************************************ - # Create WinUtil shortcut on the desktop - # - $desktopPath = "$($env:USERPROFILE)\Desktop" - # Specify the target PowerShell command - $command = "powershell.exe -NoProfile -ExecutionPolicy Bypass -Command 'irm https://christitus.com/win | iex'" - # Specify the path for the shortcut - $shortcutPath = Join-Path $desktopPath 'winutil.lnk' - # Create a shell object - $shell = New-Object -ComObject WScript.Shell - - # Create a shortcut object - $shortcut = $shell.CreateShortcut($shortcutPath) - - if (Test-Path -Path "$env:HOMEDRIVE\Windows\cttlogo.png") { - $shortcut.IconLocation = "$env:HOMEDRIVE\Windows\cttlogo.png" - } - - # Set properties of the shortcut - $shortcut.TargetPath = "powershell.exe" - $shortcut.Arguments = "-NoProfile -ExecutionPolicy Bypass -Command `"$command`"" - # Save the shortcut - $shortcut.Save() - - # Make the shortcut have 'Run as administrator' property on - $bytes = [System.IO.File]::ReadAllBytes($shortcutPath) - # Set byte value at position 0x15 in hex, or 21 in decimal, from the value 0x00 to 0x20 in hex - $bytes[0x15] = $bytes[0x15] -bor 0x20 - [System.IO.File]::WriteAllBytes($shortcutPath, $bytes) - - Write-Host "Shortcut created at: $shortcutPath" - # - # Done create WinUtil shortcut on the desktop - # ************************************************ - try { if ((Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -like "Recall" }).Count -gt 0) diff --git a/functions/public/Invoke-WPFButton.ps1 b/functions/public/Invoke-WPFButton.ps1 index 1dc7f4dd..7fe63d62 100644 --- a/functions/public/Invoke-WPFButton.ps1 +++ b/functions/public/Invoke-WPFButton.ps1 @@ -50,7 +50,6 @@ function Invoke-WPFButton { "WPFFixesNetwork" {Invoke-WPFFixesNetwork} "WPFUpdatesdisable" {Invoke-WPFUpdatesdisable} "WPFUpdatessecurity" {Invoke-WPFUpdatessecurity} - "WPFWinUtilShortcut" {Invoke-WPFShortcut -ShortcutToAdd "WinUtil" -RunAsAdmin $true} "WPFGetInstalled" {Invoke-WPFGetInstalled -CheckBox "winget"} "WPFGetInstalledTweaks" {Invoke-WPFGetInstalled -CheckBox "tweaks"} "WPFGetIso" {Invoke-MicrowinGetIso} diff --git a/functions/public/Invoke-WPFShortcut.ps1 b/functions/public/Invoke-WPFShortcut.ps1 deleted file mode 100644 index e4e47871..00000000 --- a/functions/public/Invoke-WPFShortcut.ps1 +++ /dev/null @@ -1,72 +0,0 @@ -function Invoke-WPFShortcut { - <# - - .SYNOPSIS - Creates a shortcut and prompts for a save location - - .PARAMETER ShortcutToAdd - The name of the shortcut to add - - .PARAMETER RunAsAdmin - A boolean value to make 'Run as administrator' property on (true) or off (false), defaults to off - - #> - param( - $ShortcutToAdd, - [bool]$RunAsAdmin = $false - ) - - # Preper the Shortcut Fields and add an a Custom Icon if it's available, else don't add a Custom Icon. - - Switch ($ShortcutToAdd) { - "WinUtil" { - # Use Powershell 7 if installed and fallback to PS5 if not - if (Get-Command "pwsh" -ErrorAction SilentlyContinue) { - $shell = "pwsh.exe" - } else { - $shell = "powershell.exe" - } - - $shellArgs = "-ExecutionPolicy Bypass -Command `"Start-Process $shell -verb runas -ArgumentList `'-Command `"irm https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1 | iex`"`'" - - $DestinationName = "WinUtil.lnk" - } - } - - # Show a File Dialog Browser, to let the User choose the Name and Location of where to save the Shortcut - $FileBrowser = New-Object System.Windows.Forms.SaveFileDialog - $FileBrowser.InitialDirectory = [Environment]::GetFolderPath('Desktop') - $FileBrowser.Filter = "Shortcut Files (*.lnk)|*.lnk" - $FileBrowser.FileName = $DestinationName - - # Do an Early Return if the Save Operation was canceled by User's Input. - $FileBrowserResult = $FileBrowser.ShowDialog() - $DialogResultEnum = New-Object System.Windows.Forms.DialogResult - if (-not ($FileBrowserResult -eq $DialogResultEnum::OK)) { - return - } - - # Prepare the Shortcut paramter - $WshShell = New-Object -comObject WScript.Shell - $Shortcut = $WshShell.CreateShortcut($FileBrowser.FileName) - $Shortcut.TargetPath = $shell - $Shortcut.Arguments = $shellArgs - if (-NOT (Test-Path -Path $winutildir["logo.ico"])) { - Invoke-WebRequest -Uri "https://christitus.com/images/logo-full.ico" -OutFile $winutildir["logo.ico"] - } - if (Test-Path -Path $winutildir["logo.ico"]) { - $shortcut.IconLocation = $winutildir["logo.ico"] - } - - # Save the Shortcut to disk - $Shortcut.Save() - - if ($RunAsAdmin -eq $true) { - $bytes = [System.IO.File]::ReadAllBytes($FileBrowser.FileName) - # Set byte value at position 0x15 in hex, or 21 in decimal, from the value 0x00 to 0x20 in hex - $bytes[0x15] = $bytes[0x15] -bor 0x20 - [System.IO.File]::WriteAllBytes($FileBrowser.FileName, $bytes) - } - - Write-Host "Shortcut for $ShortcutToAdd has been saved to $($FileBrowser.FileName) with 'Run as administrator' set to $RunAsAdmin" -} diff --git a/functions/public/Invoke-WPFUpdatesdefault.ps1 b/functions/public/Invoke-WPFUpdatesdefault.ps1 index 0b786f32..0b8403c6 100644 --- a/functions/public/Invoke-WPFUpdatesdefault.ps1 +++ b/functions/public/Invoke-WPFUpdatesdefault.ps1 @@ -42,4 +42,24 @@ function Invoke-WPFUpdatesdefault { Write-Host "===================================================" Write-Host "--- Windows Update Settings Reset to Default ---" Write-Host "===================================================" + + Start-Process -FilePath "secedit" -ArgumentList "/configure /cfg $env:windir\inf\defltbase.inf /db defltbase.sdb /verbose" -Wait + Start-Process -FilePath "cmd.exe" -ArgumentList "/c RD /S /Q $env:WinDir\System32\GroupPolicyUsers" -Wait + Start-Process -FilePath "cmd.exe" -ArgumentList "/c RD /S /Q $env:WinDir\System32\GroupPolicy" -Wait + Start-Process -FilePath "gpupdate" -ArgumentList "/force" -Wait + Remove-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies" -Recurse -Force -ErrorAction SilentlyContinue + Remove-Item -Path "HKCU:\Software\Microsoft\WindowsSelfHost" -Recurse -Force -ErrorAction SilentlyContinue + Remove-Item -Path "HKCU:\Software\Policies" -Recurse -Force -ErrorAction SilentlyContinue + Remove-Item -Path "HKLM:\Software\Microsoft\Policies" -Recurse -Force -ErrorAction SilentlyContinue + Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies" -Recurse -Force -ErrorAction SilentlyContinue + Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" -Recurse -Force -ErrorAction SilentlyContinue + Remove-Item -Path "HKLM:\Software\Microsoft\WindowsSelfHost" -Recurse -Force -ErrorAction SilentlyContinue + Remove-Item -Path "HKLM:\Software\Policies" -Recurse -Force -ErrorAction SilentlyContinue + Remove-Item -Path "HKLM:\Software\WOW6432Node\Microsoft\Policies" -Recurse -Force -ErrorAction SilentlyContinue + Remove-Item -Path "HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Policies" -Recurse -Force -ErrorAction SilentlyContinue + Remove-Item -Path "HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" -Recurse -Force -ErrorAction SilentlyContinue + + Write-Host "===================================================" + Write-Host "--- Windows Local Policies Reset to Default ---" + Write-Host "===================================================" } diff --git a/overrides/main.html b/overrides/main.html index bf27a2c6..c8d5a413 100644 --- a/overrides/main.html +++ b/overrides/main.html @@ -4,6 +4,7 @@ {{ super() }}
Announcement: We are currently not adding any applications to WinUtil and any apps that will be added through a PR will be declined by the maintainer. + Announcement: We are currently reworking the docs to use Hugo rather then mkdocs.
{% endblock %}