diff --git a/README.md b/README.md index 95bf473..0385e9b 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,23 @@ This utility is a compilation of Windows tasks I perform on each Windows system ![screen-install](screen-install.png) -## Usage: +## Usage -Requires you to launch PowerShell or Windows Terminal As **ADMINISTRATOR!** -The recommended way is to right-click on the start menu and select (PowerShell As Admin *Windows 10* - Windows Terminal As Admin *Windows 11*) +Winutil must be run in Admin mode because it performs system-wide tweaks. To achieve this, open PowerShell or Windows Terminal as an administrator. Here are a few ways to do it: -Launch Command: +1. **Right-Click Method:** + - Right-click on the start menu. + - Choose "PowerShell As Admin" (for Windows 10) or "Windows Terminal As Admin" (for Windows 11). + +2. **Search and Launch Method:** + - Press the Windows key. + - Type "PowerShell" or "Terminal" (for Windows 11). + - Press `Ctrl + Shift + Enter` to launch it with administrator privileges. + + +### Launch Command + +#### Simple way ``` iwr -useb https://christitus.com/win | iex @@ -20,7 +31,31 @@ irm https://christitus.com/win | iex ``` Courtesy of the issue raised at: [#144](/../../issues/144) -### Issues: +if for some reason this site is not reachable from your country please try running it directly from github + +``` +irm https://raw.githubusercontent.com/ChrisTitusTech/winutil/main/winutil.ps1 | iex +``` + +#### Automation + +Some features are avaliable through automation. This allows you to save your config file pass it to Winutil walk away and come back to a finished system. Here is how you can set it up currently with Winutil >24.01.15 + +1. On the Install Tab, click "Get Installed", this will get all installed apps **supported by Winutil** on the system + ![GetInstalled](/wiki/Get-Installed.png) +2. Click on the Settings cog in the upper right corner and chose Export, chose file file and location, this will export the setting file. + ![SettingsExport](/wiki/Settings-Export.png) +3. Copy this file to a USB or somewhere you can use after Windows installation +4. Use Microwin tab to create a cusom Windows image +5. Install the Windows image +6. In the new Windows, Open PowerShell in the admin mode and run command to automatically apply twekas and install apps from the config file +``` +irm https://christitus.com/win -Config [path-to-your-config] -Run | iex +``` +7. Have a cup of coffee! Come back when it's done. + + +## Issues: - 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 may use a VPN or change your DNS provider to Google/Cloudflare/etc. @@ -96,6 +131,8 @@ When creating pull requests, it is essential to thoroughly document all changes By following these guidelines, we can maintain a high standard of quality and ensure that the codebase remains organized and well-documented. +NOTE: When creating a function please include "WPF" or "WinUtil" in the name so that it can be loaded into the runspace. + ## Thanks to all Contributors Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻. diff --git a/config/applications.json b/config/applications.json index c5ffd99..3c3a4f2 100755 --- a/config/applications.json +++ b/config/applications.json @@ -59,7 +59,7 @@ "category": "Browsers", "panel": "0", "content": "Floorp", - "link": "https://github.com/Floorp-Projects/Floorp", + "link": "https://floorp.app/", "description": "Floorp is an open-source web browser project that aims to provide a simple and fast browsing experience." }, "WPFInstalllibrewolf": { @@ -125,6 +125,96 @@ "link": "https://www.chatterino.com/", "description": "Chatterino is a chat client for Twitch chat that offers a clean and customizable interface for a better streaming experience." }, + "WPFInstallgoogledrive": { + "winget": "Google.Drive", + "choco": "googledrive", + "category": "Utilities", + "panel": "4", + "content": "Google Drive", + "link": "https://www.google.com/drive/", + "description": "File syncing across devices all tied to your google account" + }, + "WPFInstallsynctrayzor": { + "winget": "SyncTrayzor.SyncTrayzor", + "choco": "synctrayzor", + "category": "Utilities", + "panel": "4", + "content": "Synctrayzor", + "link": "https://github.com/canton7/SyncTrayzor/", + "description": "Windows tray utility / filesystem watcher / launcher for Syncthing" + }, + "WPFInstallauthy": { + "winget": "Twilio.Authy", + "choco": "authy-desktop", + "category": "Utilities", + "panel": "4", + "content": "Authy", + "link": "https://authy.com/", + "description": "Simple and cross-platform 2FA app" + }, + "WPFInstallbleachbit": { + "winget": "BleachBit.BleachBit", + "choco": "bleachbit", + "category": "Utilities", + "panel": "4", + "content": "BleachBit", + "link": "https://www.bleachbit.org/", + "description": "Clean Your System and Free Disk Space" + }, + "WPFInstallespanso": { + "winget": "Espanso.Espanso", + "choco": "espanso", + "category": "Utilities", + "panel": "4", + "content": "Espanso", + "link": "https://espanso.org/", + "description": "Cross-platform and open-source Text Expander written in Rust" + }, + "WPFInstallpdf24creator": { + "winget": "geeksoftwareGmbH.PDF24Creator", + "choco": "pdf24", + "category": "Document", + "panel": "1", + "content": "PDF24 creator", + "link": "https://tools.pdf24.org/en/", + "description": "Free and easy-to-use online/desktop PDF tools that make you more productive" + }, + "WPFInstalllazygit": { + "winget": "JesseDuffield.lazygit", + "choco": "lazygit", + "category": "Development", + "panel": "1", + "content": "Lazygit", + "link": "https://github.com/jesseduffield/lazygit/", + "description": "Simple terminal UI for git commands" + }, + "WPFInstallwezterm": { + "winget": "wez.wezterm", + "choco": "wezterm", + "category": "Development", + "panel": "1", + "content": "Wezterm", + "link": "https://wezfurlong.org/wezterm/index.html", + "description": "WezTerm is a powerful cross-platform terminal emulator and multiplexer" + }, + "WPFInstallripgrep": { + "winget": "BurntSushi.ripgrep.MSVC", + "choco": "ripgrep", + "category": "Utilities", + "panel": "4", + "content": "Ripgrep", + "link": "https://github.com/BurntSushi/ripgrep/", + "description": "Fast and powerful commandline search tool" + }, + "WPFInstallfzf": { + "winget": "junegunn.fzf", + "choco": "fzf", + "category": "Utilities", + "panel": "4", + "content": "Fzf", + "link": "https://github.com/junegunn/fzf/", + "description": "A command-line fuzzy finder" + }, "WPFInstalldiscord": { "winget": "Discord.Discord", "choco": "discord", @@ -140,7 +230,7 @@ "category": "Communications", "panel": "0", "content": "Ferdium", - "link": "https://www.ferdiapp.com/", + "link": "https://ferdium.org/", "description": "Ferdium is a messaging application that combines multiple messaging services into a single app for easy management." }, "WPFInstallguilded": { @@ -539,6 +629,15 @@ "link": "https://code.visualstudio.com/", "description": "Visual Studio Code is a free, open-source code editor with support for multiple programming languages." }, + "WPFInstallanaconda3": { + "winget": "Anaconda.Anaconda3", + "choco": "anaconda3", + "category": "Development", + "panel": "1", + "content": "Anaconda", + "link": "https://www.anaconda.com/products/distribution", + "description": "Anaconda is a distribution of the Python and R programming languages for scientific computing." + }, "WPFInstallvscodium": { "winget": "Git.Git;VSCodium.VSCodium", "choco": "vscodium", @@ -870,7 +969,7 @@ "panel": "2", "content": "Prism Launcher", "description": "Prism Launcher is a game launcher and manager designed to provide a clean and intuitive interface for organizing and launching your games.", - "link": "https://prismlauncher.com/" + "link": "https://prismlauncher.org/" }, "WPFInstallsidequest": { "winget": "SideQuestVR.SideQuest", @@ -1061,6 +1160,15 @@ "description": "Windows Terminal is a modern, fast, and efficient terminal application for command-line users, supporting multiple tabs, panes, and more.", "link": "https://aka.ms/terminal" }, + "WPFInstallpowerbi": { + "winget": "Microsoft.PowerBI", + "choco": "powerbi", + "category": "Microsoft Tools", + "panel": "2", + "content": "Power BI", + "description": "Create stunning reports and visualizations with Power BI Desktop. It puts visual analytics at your fingertips with intuitive report authoring. Drag-and-drop to place content exactly where you want it on the flexible and fluid canvas. Quickly discover patterns as you explore a single unified view of linked, interactive visualizations.", + "link": "https://www.microsoft.com/en-us/power-platform/products/power-bi/" + }, "WPFInstallaimp": { "winget": "AIMP.AIMP", "choco": "aimp", @@ -1097,15 +1205,33 @@ "description": "Clementine is a modern music player and library organizer, supporting various audio formats and online radio services.", "link": "https://www.clementine-player.org/" }, - "WPFInstallclipgrab": { - "winget": "na", - "choco": "clipgrab", + "WPFInstallytdlp": { + "winget": "yt-dlp.yt-dlp", + "choco": "yt-dlp", "category": "Multimedia Tools", "panel": "3", - "content": "Clipgrab", - "description": "Clipgrab is a free downloader and converter for YouTube, Vimeo, Facebook, and many other online video sites.", - "link": "https://clipgrab.org/" + "content": "Yt-dlp", + "description": "Command-line tool that allows you to download videos from YouTube and other supported sites. It is an improved version of the popular youtube-dl.", + "link": "https://github.com/yt-dlp/yt-dlp" }, + "WPFInstallvideomass": { + "winget": "GianlucaPernigotto.Videomass", + "choco": "na", + "category": "Multimedia Tools", + "panel": "3", + "content": "Videomass", + "description": "Videomass by GianlucaPernigotto is a cross-platform GUI for FFmpeg, streamlining multimedia file processing with batch conversions and user-friendly features.", + "link": "https://github.com/jeanslack/Videomass" + }, + "WPFInstallffmpeg": { + "winget": "Gyan.FFmpeg", + "choco": "ffmpeg-full", + "category": "Multimedia Tools", + "panel": "3", + "content": "Ffmpeg full", + "description": "FFmpeg is a powerful multimedia processing tool that enables users to convert, edit, and stream audio and video files with a vast range of codecs and formats.", + "link": "https://ffmpeg.org/" + }, "WPFInstallcopyq": { "winget": "hluk.CopyQ", "choco": "copyq", @@ -1373,7 +1499,7 @@ "category": "Multimedia Tools", "panel": "3", "content": "Strawberry (Music Player)", - "link": "https://strawberry.rocks/", + "link": "https://github.com/strawberrymusicplayer/strawberry/", "description": "Strawberry is an open-source music player that focuses on music collection management and audio quality. It supports various audio formats and features a clean user interface." }, "WPFInstalltidal": { @@ -1736,14 +1862,14 @@ "link": "https://www.voidtools.com/", "description": "Everything Search is a fast and efficient file search utility for Windows." }, - "WPFInstallfiles": { - "winget": "YairAichenbaum.Files", + "WPFInstallfileconverter": { + "winget": "AdrienAllard.FileConverter", "choco": "files", "category": "Utilities", "panel": "4", - "content": "Files File Explorer", - "link": "https://www.yairaichenbaum.com/files", - "description": "Files is a feature-rich file explorer providing a user-friendly interface for file management." + "content": "File Converter", + "link": "https://file-converter.org/", + "description": "File Converter is a very simple tool which allows you to convert and compress one or several file(s) using the context menu in windows explorer." }, "WPFInstallflux": { "winget": "flux.flux", @@ -2089,12 +2215,12 @@ }, "WPFInstalltwinkletray": { "winget": "xanderfrangos.twinkletray", - "choco": "na", + "choco": "twinkle-tray", "category": "Utilities", "panel": "4", "content": "Twinkle Tray", - "link": "https://github.com/xanderfrangos/TwinkleTray", - "description": "Twinkle Tray is a small utility that allows you to customize the system tray icons on your Windows taskbar." + "link": "https://twinkletray.com/", + "description": "Twinkle Tray lets you easily manage the brightness levels of multiple monitors." }, "WPFInstallwindirstat": { "winget": "WinDirStat.WinDirStat", @@ -2107,11 +2233,11 @@ }, "WPFInstallwingetui": { "winget": "SomePythonThings.WingetUIStore", - "choco": "na", + "choco": "wingetui", "category": "Utilities", "panel": "4", "content": "WingetUI", - "link": "https://github.com/lostindark/WingetUIStore", + "link": "https://github.com/marticliment/WingetUI", "description": "WingetUI is a graphical user interface for Microsoft's Windows Package Manager (winget)." }, "WPFInstallwiztree": { @@ -2147,7 +2273,7 @@ "category": "Utilities", "panel": "4", "content": "WiseToys", - "link": "https://www.wisecleaner.com/wisetoys.html", + "link": "https://toys.wisecleaner.com/", "description": "WiseToys is a set of utilities and tools designed to enhance and optimize your Windows experience." }, "WPFInstallxdm": { diff --git a/functions/private/Get-WinUtilToggleStatus.ps1 b/functions/private/Get-WinUtilToggleStatus.ps1 index 77b424b..43339c5 100644 --- a/functions/private/Get-WinUtilToggleStatus.ps1 +++ b/functions/private/Get-WinUtilToggleStatus.ps1 @@ -59,6 +59,15 @@ Function Get-WinUtilToggleStatus { return $false } } + if($ToggleSwitch -eq "WPFToggleSnapFlyout"){ + $hidesnap = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').EnableSnapAssistFlyout + if($hidesnap -eq 0){ + return $false + } + else{ + return $true + } + } if($ToggleSwitch -eq "WPFToggleMouseAcceleration"){ $MouseSpeed = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseSpeed $MouseThreshold1 = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseThreshold1 diff --git a/functions/private/Install-WinUtilProgramWinget.ps1 b/functions/private/Install-WinUtilProgramWinget.ps1 index dee2cb1..20c2c9f 100644 --- a/functions/private/Install-WinUtilProgramWinget.ps1 +++ b/functions/private/Install-WinUtilProgramWinget.ps1 @@ -30,7 +30,7 @@ Function Install-WinUtilProgramWinget { Write-Progress -Activity "$manage Applications" -Status "$manage $Program $($x + 1) of $count" -PercentComplete $($x/$count*100) if($manage -eq "Installing"){ - Start-Process -FilePath winget -ArgumentList "install -e --accept-source-agreements --accept-package-agreements --silent $Program" -NoNewWindow -Wait + Start-Process -FilePath winget -ArgumentList "install -e --accept-source-agreements --accept-package-agreements --scope=machine --silent $Program" -NoNewWindow -Wait } if($manage -eq "Uninstalling"){ Start-Process -FilePath winget -ArgumentList "uninstall -e --purge --force --silent $Program" -NoNewWindow -Wait diff --git a/functions/private/Invoke-WinUtilSnapFlyout.ps1 b/functions/private/Invoke-WinUtilSnapFlyout.ps1 new file mode 100644 index 0000000..fb317ec --- /dev/null +++ b/functions/private/Invoke-WinUtilSnapFlyout.ps1 @@ -0,0 +1,34 @@ +function Invoke-WinUtilSnapFlyout { + <# + .SYNOPSIS + Disables/Enables Snap Assist Flyout on startup + .PARAMETER Enabled + Indicates whether to enable or disable Snap Assist Flyout on startup + #> + Param($Enabled) + Try{ + if ($Enabled -eq $false){ + Write-Host "Enabling Snap Assist Flyout On startup" + $value = 1 + } + else { + Write-Host "Disabling Snap Assist Flyout On startup" + $value = 0 + } + # taskkill.exe /F /IM "explorer.exe" + $Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" + taskkill.exe /F /IM "explorer.exe" + Set-ItemProperty -Path $Path -Name EnableSnapAssistFlyout -Value $value + Start-Process "explorer.exe" + } + 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-WPFGetIso.ps1 b/functions/public/Invoke-WPFGetIso.ps1 index af6f3e6..072b0c5 100644 --- a/functions/public/Invoke-WPFGetIso.ps1 +++ b/functions/public/Invoke-WPFGetIso.ps1 @@ -90,7 +90,7 @@ function Invoke-WPFGetIso { # @ChrisTitusTech please copy this wiki and change the link below to your copy of the wiki Write-Error "Failed to mount the image. Error: $($_.Exception.Message)" Write-Error "This is NOT winutil's problem, your ISO might be corrupt, or there is a problem on the system" - Write-Error "Please refer to this wiki for more details https://github.com/KonTy/winutil/wiki/Error-in-Winutil-MicroWin-during-ISO-mounting" + Write-Error "Please refer to this wiki for more details https://github.com/ChrisTitusTech/winutil/blob/main/wiki/Error-in-Winutil-MicroWin-during-ISO-mounting%2Cmd" return } # storing off values in hidden fields for further steps diff --git a/functions/public/Invoke-WPFPresets.ps1 b/functions/public/Invoke-WPFPresets.ps1 index a513776..53f4f75 100644 --- a/functions/public/Invoke-WPFPresets.ps1 +++ b/functions/public/Invoke-WPFPresets.ps1 @@ -27,7 +27,7 @@ function Invoke-WPFPresets { $CheckBoxesToCheck = $sync.configs.preset.$preset } - $CheckBoxes = $sync.GetEnumerator() | Where-Object { $_.Value -is [System.Windows.Controls.CheckBox] } + $CheckBoxes = $sync.GetEnumerator() | Where-Object { $_.Value -is [System.Windows.Controls.CheckBox] -and $_.Name -notlike "WPFToggle*" } Write-Debug "Getting checkboxes to set $($CheckBoxes.Count)" $CheckBoxesToCheck | ForEach-Object { @@ -56,4 +56,4 @@ function Invoke-WPFPresets { Write-Debug "$checkboxName is not checked" } } -} \ No newline at end of file +} diff --git a/functions/public/Invoke-WPFToggle.ps1 b/functions/public/Invoke-WPFToggle.ps1 index 593a07b..826abea 100644 --- a/functions/public/Invoke-WPFToggle.ps1 +++ b/functions/public/Invoke-WPFToggle.ps1 @@ -22,6 +22,7 @@ function Invoke-WPFToggle { "WPFToggleNumLock" {Invoke-WinUtilNumLock $(Get-WinUtilToggleStatus WPFToggleNumLock)} "WPFToggleVerboseLogon" {Invoke-WinUtilVerboseLogon $(Get-WinUtilToggleStatus WPFToggleVerboseLogon)} "WPFToggleShowExt" {Invoke-WinUtilShowExt $(Get-WinUtilToggleStatus WPFToggleShowExt)} + "WPFToggleSnapFlyout" {Invoke-WinUtilSnapFlyout $(Get-WinUtilToggleStatus WPFToggleSnapFlyout)} "WPFToggleMouseAcceleration" {Invoke-WinUtilMouseAcceleration $(Get-WinUtilToggleStatus WPFToggleMouseAcceleration)} } } \ No newline at end of file diff --git a/wiki/Battery.md b/wiki/Battery.md new file mode 100644 index 0000000..e8f1d08 --- /dev/null +++ b/wiki/Battery.md @@ -0,0 +1,83 @@ +# Battery drains too fast. +When your battery on teh laptop drains too fast please perform these steps and report the results back to Winutil community. + +1. **Check Battery Health:** + - Open a Command Prompt as an administrator. + - Run the following command to generate a battery report: + ```powershell + powercfg /batteryreport /output "C:\battery_report.html" + ``` + - Open the generated HTML report to review information about battery health and usage. + +2. **Review Power Settings:** + - Go to "Settings" > "System" > "Power & sleep." + - Adjust power plan settings based on your preferences and usage patterns. + - Click on "Additional power settings" to access advanced power settings. + +3. **Identify Power-Hungry Apps:** + - Right-click on the taskbar and select "Task Manager." + - Navigate to the "Processes" tab to identify applications with high CPU or memory usage. + - Consider closing unnecessary background applications. + +4. **Update Drivers:** + - Visit your laptop manufacturer's website or use Windows Update to check for driver updates. + - Ensure graphics, chipset, and other essential drivers are up to date. + +5. **Check for Windows Updates:** + - Go to "Settings" > "Update & Security" > "Windows Update." + - Check for and install any available updates for your operating system. + +6. **Reduce Screen Brightness:** + - Adjust screen brightness based on your preferences and lighting conditions. + - Go to "Settings" > "System" > "Display" to adjust brightness. + +7. **Battery Saver Mode:** + - Go to "Settings" > "System" > "Battery." + - Turn on "Battery saver" to limit background activity and conserve power. + +8. **Check Power Usage in Settings:** + - Go to "Settings" > "System" > "Battery" > "Battery usage by app." + - Review the list of apps and their power usage. + +9. **Check Background Apps:** + - Go to "Settings" > "Privacy" > "Background apps." + - Disable unnecessary apps running in the background. + +10. **Use Powercfg for Analysis:** + - Open a Command Prompt as an administrator. + - Run the following command to analyze energy usage and generate a report: + ```powershell + powercfg /energy /output "C:\energy_report.html" + ``` + - Open the generated HTML report to identify energy consumption patterns. + +11. **Review Event Viewer:** + - Open Event Viewer by searching for it in the Start menu. + - Navigate to "Windows Logs" > "System." + - Look for events with the source "Power-Troubleshooter" to identify power-related events. + +12. **Check Wake-up Sources:** + - Open a Command Prompt as an administrator. + - Use the command `powercfg /requests` to identify processes preventing sleep. + - Check Task Scheduler for tasks waking up the computer. + - Use the command `powercfg /waketimers` to view active wake timers. + +13. **Resource Monitor:** + - Open Resource Monitor from the Start menu. + - Navigate to the "CPU" tab and identify processes with high CPU usage. + +14. **Windows Settings - Activity History:** + - In "Settings," go to "Privacy" > "Activity history." + - Turn off "Let Windows collect my activities from this PC." + +15. **Network Adapters:** + - Open Device Manager by searching for it in the Start menu. + - Locate your network adapter, right-click, and go to "Properties." + - Under the "Power Management" tab, uncheck the option that allows the device to wake the computer. + +16. **Review Installed Applications:** + - Manually review installed applications by searching for "Add or remove programs" in the Start menu. + - Check settings/preferences of individual applications for power-related options. + - Uninstall unnecessary or problematic software. + +By following these detailed instructions, you should be able to thoroughly diagnose and address battery drain issues on your Windows laptop. Adjust settings as needed to optimize power management and improve battery life. \ No newline at end of file diff --git a/wiki/Error-in-Winutil-MicroWin-during-ISO-mounting,md b/wiki/Error-in-Winutil-MicroWin-during-ISO-mounting,md new file mode 100644 index 0000000..7bb47eb --- /dev/null +++ b/wiki/Error-in-Winutil-MicroWin-during-ISO-mounting,md @@ -0,0 +1,39 @@ +# Troubleshoot errors during Microwin usage + +## Error `0x80041031` + +This error code typically indicates an issue related to Windows Management Instrumentation (WMI). Here are a few steps you can try to resolve the issue: + +1. **Reboot Your Computer:** + Sometimes, a simple reboot can resolve temporary issues. Restart your computer and try mounting the ISO again. + +2. **Check for System Corruption:** + Run the System File Checker (SFC) utility to scan and repair system files that may be corrupted. + ```powershell + sfc /scannow + ``` + +3. **Update Your System:** + Make sure your operating system is up-to-date. Check for Windows updates and install any pending updates. + +4. **Check WMI Service:** + Ensure that the Windows Management Instrumentation (WMI) service is running. You can do this through the Services application: + - Press `Win + R` to open the Run dialog. + - Type `services.msc` and press Enter. + - Locate "Windows Management Instrumentation" in the list. + - Make sure its status is set to "Running" and the startup type is set to "Automatic." + +5. **Check for Security Software Interference:** + Security software can sometimes interfere with WMI operations. Temporarily disable your antivirus or security software and check if the issue persists. + +6. **Event Viewer:** + Check the Event Viewer for more detailed error information. Look for entries related to the `80041031` error and check if there are any additional details that can help identify the cause. + + - Press `Win + X` and select "Event Viewer." + - Navigate to "Windows Logs" -> "Application" or "System." + - Look for entries with the source related to WMI or the application you're using to mount the ISO. + +7. **ISO File Integrity:** + Ensure that the ISO file you are trying to mount is not corrupted. Try mounting a different ISO file to see if the issue persists. + +If the problem persists after trying these steps, additional troubleshooting may be required. Consider seeking assistance from Microsoft support or community forums for more specific guidance based on your system configuration and the software you are using to mount the ISO. \ No newline at end of file diff --git a/wiki/Get-Installed.png b/wiki/Get-Installed.png new file mode 100644 index 0000000..0cfc79d Binary files /dev/null and b/wiki/Get-Installed.png differ diff --git a/wiki/Settings-Export.png b/wiki/Settings-Export.png new file mode 100644 index 0000000..d94b153 Binary files /dev/null and b/wiki/Settings-Export.png differ diff --git a/winutil.ps1 b/winutil.ps1 index f29d2d2..036b629 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -10,7 +10,7 @@ Author : Chris Titus @christitustech Runspace Author: @DeveloperDurp GitHub : https://github.com/ChrisTitusTech - Version : 24.01.15 + Version : 24.01.25 #> param ( [switch]$Debug, @@ -47,7 +47,7 @@ Add-Type -AssemblyName System.Windows.Forms # Variable to sync between runspaces $sync = [Hashtable]::Synchronized(@{}) $sync.PSScriptRoot = $PSScriptRoot -$sync.version = "24.01.15" +$sync.version = "24.01.25" $sync.configs = @{} $sync.ProcessRunning = $false @@ -452,6 +452,15 @@ Function Get-WinUtilToggleStatus { return $false } } + if($ToggleSwitch -eq "WPFToggleSnapFlyout"){ + $hidesnap = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').EnableSnapAssistFlyout + if($hidesnap -eq 0){ + return $false + } + else{ + return $true + } + } if($ToggleSwitch -eq "WPFToggleMouseAcceleration"){ $MouseSpeed = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseSpeed $MouseThreshold1 = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseThreshold1 @@ -558,7 +567,7 @@ Function Install-WinUtilProgramWinget { Write-Progress -Activity "$manage Applications" -Status "$manage $Program $($x + 1) of $count" -PercentComplete $($x/$count*100) if($manage -eq "Installing"){ - Start-Process -FilePath winget -ArgumentList "install -e --accept-source-agreements --accept-package-agreements --silent $Program" -NoNewWindow -Wait + Start-Process -FilePath winget -ArgumentList "install -e --accept-source-agreements --accept-package-agreements --scope=machine --silent $Program" -NoNewWindow -Wait } if($manage -eq "Uninstalling"){ Start-Process -FilePath winget -ArgumentList "uninstall -e --purge --force --silent $Program" -NoNewWindow -Wait @@ -1599,6 +1608,40 @@ function Invoke-WinUtilShowExt { Write-Warning $psitem.Exception.StackTrace } } +function Invoke-WinUtilSnapFlyout { + <# + .SYNOPSIS + Disables/Enables Snap Assist Flyout on startup + .PARAMETER Enabled + Indicates whether to enable or disable Snap Assist Flyout on startup + #> + Param($Enabled) + Try{ + if ($Enabled -eq $false){ + Write-Host "Enabling Snap Assist Flyout On startup" + $value = 1 + } + else { + Write-Host "Disabling Snap Assist Flyout On startup" + $value = 0 + } + # taskkill.exe /F /IM "explorer.exe" + $Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" + taskkill.exe /F /IM "explorer.exe" + Set-ItemProperty -Path $Path -Name EnableSnapAssistFlyout -Value $value + Start-Process "explorer.exe" + } + 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 { <# @@ -2663,7 +2706,7 @@ function Invoke-WPFGetIso { # @ChrisTitusTech please copy this wiki and change the link below to your copy of the wiki Write-Error "Failed to mount the image. Error: $($_.Exception.Message)" Write-Error "This is NOT winutil's problem, your ISO might be corrupt, or there is a problem on the system" - Write-Error "Please refer to this wiki for more details https://github.com/KonTy/winutil/wiki/Error-in-Winutil-MicroWin-during-ISO-mounting" + Write-Error "Please refer to this wiki for more details https://github.com/ChrisTitusTech/winutil/blob/main/wiki/Error-in-Winutil-MicroWin-during-ISO-mounting%2Cmd" return } # storing off values in hidden fields for further steps @@ -3330,7 +3373,7 @@ function Invoke-WPFPresets { $CheckBoxesToCheck = $sync.configs.preset.$preset } - $CheckBoxes = $sync.GetEnumerator() | Where-Object { $_.Value -is [System.Windows.Controls.CheckBox] } + $CheckBoxes = $sync.GetEnumerator() | Where-Object { $_.Value -is [System.Windows.Controls.CheckBox] -and $_.Name -notlike "WPFToggle*" } Write-Debug "Getting checkboxes to set $($CheckBoxes.Count)" $CheckBoxesToCheck | ForEach-Object { @@ -3510,6 +3553,7 @@ function Invoke-WPFToggle { "WPFToggleNumLock" {Invoke-WinUtilNumLock $(Get-WinUtilToggleStatus WPFToggleNumLock)} "WPFToggleVerboseLogon" {Invoke-WinUtilVerboseLogon $(Get-WinUtilToggleStatus WPFToggleVerboseLogon)} "WPFToggleShowExt" {Invoke-WinUtilShowExt $(Get-WinUtilToggleStatus WPFToggleShowExt)} + "WPFToggleSnapFlyout" {Invoke-WinUtilSnapFlyout $(Get-WinUtilToggleStatus WPFToggleSnapFlyout)} "WPFToggleMouseAcceleration" {Invoke-WinUtilMouseAcceleration $(Get-WinUtilToggleStatus WPFToggleMouseAcceleration)} } } @@ -4881,6 +4925,11 @@ $inputXML = ' + + + + + +