diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 30a94605..d0ae5a1d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -22,10 +22,8 @@ [Discuss the impact of your changes on the project. This might include effects on performance, new dependencies, or changes in behaviour.] ## Issue related to PR -[What issue is related to this PR (if any)] +[What issue/discussion is related to this PR (if any)] - Resolves # -[What discussion is related to this PR (if any)] -- Discussion: # ## Additional Information [Any additional information that reviewers should be aware of.] @@ -35,4 +33,4 @@ - [ ] I have performed a self-review of my own code. - [ ] I have commented my code, particularly in hard-to-understand areas. - [ ] I have made corresponding changes to the documentation. -- [ ] My changes generate no errors/warnings/merge conflicts. +- [ ] My changes generate no errors/warnings/merge conflicts. diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..d70b5015 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + ignore: + - dependency-name: "actions/stale" + versions: '>= 9' \ No newline at end of file diff --git a/.github/workflows/close-discussion.yml b/.github/workflows/close-discussion.yml index c320a275..03a6d9b9 100644 --- a/.github/workflows/close-discussion.yml +++ b/.github/workflows/close-discussion.yml @@ -16,7 +16,7 @@ jobs: if: github.event.pull_request.merged == true id: extract-discussion run: | - echo "::set-output name=discussion::$(echo "${{ github.event.pull_request.body }}" | grep -oP '(?<=Discussion: #)\d+')" + echo "discussion=$(echo '${{ github.event.pull_request.body }}' | grep -oP '(?<=Resolves #)\d+')" >> $GITHUB_OUTPUT shell: bash - name: Close the discussion diff --git a/.github/workflows/createchangelog.yml b/.github/workflows/createchangelog.yml index 425d3048..39343744 100644 --- a/.github/workflows/createchangelog.yml +++ b/.github/workflows/createchangelog.yml @@ -1,17 +1,42 @@ -name: On release published +name: Update update.mb on Release + on: release: - types: [published] + types: [published, prereleased] + workflow_dispatch: # Add this line to enable manual triggering jobs: - changelog: - name: Update changelog + update-file: runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 - with: - ref: main - - uses: rhysd/changelog-from-release/action@v3 - with: - file: /docs/updates.md - github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Get all releases and update update.mb file + run: | + # Fetch all releases including pre-releases using GitHub CLI + gh release list --limit 5 > releases.txt + + # Extract numeric versions and create update.mb content + echo "" > docs/update.mb + while read -r line; do + tag=$(echo "$line" | awk '{print $1}') + name=$(echo "$line" | awk -F'\t' '{print $2}') + version_numeric=$(echo "$tag" | grep -o -E '[0-9.]+') + body=$(gh release view "$tag" --json body --jq .body) + echo "## $version_numeric" >> docs/update.mb + echo "Release name: $name" >> docs/update.mb + echo "Release body: $body" >> docs/update.mb + echo "" >> docs/update.mb + done < releases.txt + + - name: Commit and Push Changes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git add docs/update.mb + git commit -m "Update update.mb with all releases" + git push diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 815a32ef..48b6e6f1 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -2,7 +2,7 @@ name: GitHub Pages Deploy on: push: branches: - - master + - master - main permissions: contents: write @@ -10,11 +10,11 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: 3.x - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: key: ${{ github.ref }} path: .cache diff --git a/.github/workflows/issue-slash-commands.yaml b/.github/workflows/issue-slash-commands.yaml new file mode 100644 index 00000000..080fa9db --- /dev/null +++ b/.github/workflows/issue-slash-commands.yaml @@ -0,0 +1,43 @@ +name: Close issue on /close + +on: + issue_comment: + types: [created, edited] + +jobs: + closeIssueOnClose: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: none + contents: read + + steps: + - name: Check for /close comment + id: check_comment + run: | + if [[ "${{ contains(github.event.comment.body, '/close') }}" == "true" ]]; then + echo "comment=true" >> $GITHUB_ENV + else + echo "comment=false" >> $GITHUB_ENV + fi + + - name: Check if the user is allowed + id: check_user + if: env.comment == 'true' + run: | + ALLOWED_USERS=("ChrisTitusTech" "og-mrk" "Marterich" "MyDrift-user" "Real-MullaC") + if [[ " ${ALLOWED_USERS[@]} " =~ " ${{ github.event.comment.user.login }} " ]]; then + echo "user=true" >> $GITHUB_ENV + else + echo "user=false" >> $GITHUB_ENV + fi + + - name: Close issue if conditions are met + if: env.comment == 'true' && env.user == 'true' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ISSUE_NUMBER: ${{ github.event.issue.number }} + run: | + echo Closing the issue... + gh issue close $ISSUE_NUMBER --repo ${{ github.repository }} \ No newline at end of file diff --git a/.github/workflows/pre-release.yaml b/.github/workflows/pre-release.yaml index b1d9e7e4..69890cf3 100644 --- a/.github/workflows/pre-release.yaml +++ b/.github/workflows/pre-release.yaml @@ -1,8 +1,12 @@ name: Pre-Release WinUtil +permissions: + contents: write + actions: read + on: workflow_run: - workflows: ["Compile"] #Ensure Compile winget.ps1 is done + workflows: ["Compile"] types: - completed workflow_dispatch: # Manual trigger added @@ -10,8 +14,6 @@ on: jobs: build-runspace: runs-on: windows-latest - outputs: - version: ${{ steps.extract_version.outputs.version }} steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -19,18 +21,19 @@ jobs: - name: Extract Version from winutil.ps1 id: extract_version run: | - $version = '' - Get-Content ./winutil.ps1 -TotalCount 30 | ForEach-Object { - if ($_ -match 'Version\s*:\s*(\d{2}\.\d{2}\.\d{2})') { - $version = "pre"+$matches[1] - echo "version=$version" >> $GITHUB_ENV - echo "::set-output name=version::$version" - break - } - } - if (-not $version) { - Write-Error "Version not found in winutil.ps1" - exit 1 + $version = (Get-Date -Format "yy.MM.dd") + echo "version=$version" >> $env:GITHUB_ENV + shell: pwsh + + - name: Create Tag + id: create_tag + run: | + $tagExists = git tag -l $env:VERSION + if ($tagExists -eq "") { + git tag $env:VERSION + git push origin $env:VERSION + } else { + Write-Host "Tag $env:VERSION already exists, skipping tag creation" } shell: pwsh @@ -38,11 +41,12 @@ jobs: id: create_release uses: softprops/action-gh-release@v2 with: - tag_name: ${{ steps.extract_version.outputs.version }} - name: Pre-Release ${{ steps.extract_version.outputs.version }} - body: "![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/winutil/${{ steps.extract_version.outputs.version }}/winutil.ps1)" - append_body: true + tag_name: ${{ env.VERSION }} + name: Pre-Release ${{ env.VERSION }} + body: "![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/winutil/${{ env.VERSION }}/winutil.ps1)" + append_body: false files: ./winutil.ps1 prerelease: true + generate_release_notes: true env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 61085b64..df5f3d5d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -19,8 +19,7 @@ jobs: Get-Content ./winutil.ps1 -TotalCount 30 | ForEach-Object { if ($_ -match 'Version\s*:\s*(\d{2}\.\d{2}\.\d{2})') { $version = $matches[1] - echo "version=$version" >> $GITHUB_ENV - echo "::set-output name=version::$version" + echo "version=$version" >> $GITHUB_OUTPUT break } } diff --git a/.github/workflows/sponsors.yml b/.github/workflows/sponsors.yml index 06a6dab5..6a0e22b0 100644 --- a/.github/workflows/sponsors.yml +++ b/.github/workflows/sponsors.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Generate Sponsors 💖 uses: JamesIves/github-sponsors-readme-action@v1 diff --git a/.github/workflows/unittests.yaml b/.github/workflows/unittests.yaml index 659d9ab1..02879545 100644 --- a/.github/workflows/unittests.yaml +++ b/.github/workflows/unittests.yaml @@ -8,7 +8,7 @@ jobs: name: PS Script Analyzer runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: lint uses: devblackops/github-action-psscriptanalyzer@master with: @@ -22,7 +22,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Pester run: | diff --git a/Battery.txt b/Battery.txt deleted file mode 100644 index 243cc3c0..00000000 --- a/Battery.txt +++ /dev/null @@ -1,83 +0,0 @@ -# Battery drains too fast. -When your battery on the laptop drains too fast, please perform these steps and report the results back to the 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. diff --git a/Error-in-Winutil-MicroWin-during-ISO-mounting.txt b/Error-in-Winutil-MicroWin-during-ISO-mounting.txt deleted file mode 100644 index 072c76da..00000000 --- a/Error-in-Winutil-MicroWin-during-ISO-mounting.txt +++ /dev/null @@ -1,39 +0,0 @@ -# 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 to set its status to "Running" and the startup type 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 use to mount the ISO. - -7. **ISO File Integrity:** - Ensure that the ISO file you are trying to mount is uncorrupted. Try mounting a different ISO file to see if the issue persists. - -If the problem persists after trying these steps, additional troubleshooting is required. Consider seeking assistance from Microsoft support or community forums for more specific guidance based on your system configuration and the software you use to mount the ISO. diff --git a/README.md b/README.md index be2b2fb0..b16292fb 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ irm "https://christitus.com/windev" | iex If you have Issues, refer to [Known Issues](https://christitustech.github.io/winutil/KnownIssues/) -## 🎓 Documenation +## 🎓 Documentation ### [WinUtil Official Documentation](https://christitustech.github.io/winutil/) @@ -54,7 +54,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. -Gregory NavasarkianYusuke SaitoTriHyderaMark AmosJason A. DiegmuellerBrogan BranstetterwyattMetalliDan28Jan WilleOwen +Gregory NavasarkianYusuke SaitoTriHyderaMark AmosJason A. DiegmuellerBrogan BranstetterwyattMetalliDan28Jan WilleOwenStefan ## 🏅 Thanks to all Contributors Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻. diff --git a/docs/KnownIssues.md b/docs/KnownIssues.md index 3f1e5ce8..fae5c42c 100644 --- a/docs/KnownIssues.md +++ b/docs/KnownIssues.md @@ -51,3 +51,127 @@ Get-Service -Name "XboxGipSvc" | Set-Service -StartupType Automatic - (Windows 11) Quick Settings no longer works: Launch the Script and click 'Enable Action Center' - Explorer no longer launches: Go to Control Panel, File Explorer Options, Change the 'Open File Explorer to' option to 'This PC'. + +### Battery drains too fast. +When your battery on the laptop drains too fast, please perform these steps and report the results back to the 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. + +### 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 to set its status to "Running" and the startup type 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 use to mount the ISO. + +7. **ISO File Integrity:** + Ensure that the ISO file you are trying to mount is uncorrupted. Try mounting a different ISO file to see if the issue persists. + +If the problem persists after trying these steps, additional troubleshooting is required. Consider seeking assistance from Microsoft support or community forums for more specific guidance based on your system configuration and the software you use to mount the ISO. \ No newline at end of file diff --git a/docs/assets/TweaksScreen.PNG b/docs/assets/TweaksScreen.png similarity index 100% rename from docs/assets/TweaksScreen.PNG rename to docs/assets/TweaksScreen.png diff --git a/docs/contribute.md b/docs/contribute.md index 857f425e..cee42965 100644 --- a/docs/contribute.md +++ b/docs/contribute.md @@ -27,8 +27,8 @@ * Fork the WinUtil Repository [here](https://github.com/ChrisTitusTech/winutil) to create a copy that will be available in your Repository-list. ![Fork](assets/ForkButton.png) -### Clone the Fork -* While you can make your changes directly through the Web, we recommend cloning the repo to your device to test your fork easily. +### Clone the Fork +* While you can make your changes directly through the Web, we recommend cloning the repo to your device to test your fork easily. * Using the application GitHub Desktop (available in WinUtil) you can easily manage your repos locally. You can do it using other tools like git-cli (available in WinUtil), we recommend GitHub Desktop for ease of use. * Install GitHub Desktop if not already installed * Log in using the same GitHub account u used to fork WinUtil diff --git a/docs/img/ProgramInstall.png b/docs/img/ProgramInstall.png deleted file mode 100644 index 654fcadc..00000000 Binary files a/docs/img/ProgramInstall.png and /dev/null differ diff --git a/docs/img/ProgramInstallButton.png b/docs/img/ProgramInstallButton.png deleted file mode 100644 index 4a3b181b..00000000 Binary files a/docs/img/ProgramInstallButton.png and /dev/null differ diff --git a/docs/img/favicon.png b/docs/img/favicon.png deleted file mode 100644 index a4f4bc5d..00000000 Binary files a/docs/img/favicon.png and /dev/null differ diff --git a/docs/userguide.md b/docs/userguide.md index 38a1e412..903a8d29 100644 --- a/docs/userguide.md +++ b/docs/userguide.md @@ -33,7 +33,7 @@ #### Tweaks Addition * To enable tweaks on your system select Tweaks at the top next to Install. -* Then you can select what tweaks you want adding to your system. We do have some presets you can select from at the top you can see this in the picture below. +* Then you can select what tweaks you want adding to your system. We do have some presets you can select from at the top you can see this in the picture below. ![Tweaks Screen](assets/TweaksScreen.PNG) * After you have chosen your tweaks click the Run Tweaks button at the bottom of the screen. @@ -114,7 +114,7 @@ * **Keep Provisioned Packages**: leaving this option unticked (default) will try to remove every operating system package Some packages may remain after processing. This can happen if the packages in question were permanent ones or had been superseded by newer versions - + * **Keep Appx Packages**: leaving this option unticked (default) will try to remove every Microsoft Store app from the Windows image This option will exclude some applications that are essential in the case that you want or need to add a Store app later on @@ -122,7 +122,7 @@ * **Keep Defender**: leaving this option unticked will try to remove every part of Windows Defender, including the Windows Security app Leaving this option unticked is **NOT recommended** unless you plan to use a third-party antivirus solution on your MicroWin installation. On that regard, don't install AVs with bad reputation or rogueware - + * **Keep Edge**: leaving this option unticked will try to remove every part of the Microsoft Edge browser using the best methods available Leaving this option unticked is not recommended because it might break some applications that might depend on the `Edge WebView2` runtime. However, if that happens, you can easily [reinstall it](https://developer.microsoft.com/en-us/microsoft-edge/webview2) @@ -141,7 +141,7 @@ * **Copy to Ventoy** will copy the target ISO file to any USB drive with [Ventoy](https://ventoy.net/en/index.html) installed Ventoy is a solution that lets you boot to any ISO file stored in a drive. Think of it as having multiple bootable USBs in one. Do note though that your drive needs to have enough free space for the target ISO file - + ## Automation diff --git a/functions/private/Install-WinUtilProgramWinget.ps1 b/functions/private/Install-WinUtilProgramWinget.ps1 index 401e3586..298c843e 100644 --- a/functions/private/Install-WinUtilProgramWinget.ps1 +++ b/functions/private/Install-WinUtilProgramWinget.ps1 @@ -22,18 +22,17 @@ Function Install-WinUtilProgramWinget { [Parameter(Position=1)] [String]$manage = "Installing" ) - + $x = 0 $count = $ProgramsToInstall.Count Write-Progress -Activity "$manage Applications" -Status "Starting" -PercentComplete 0 Write-Host "===========================================" Write-Host "-- Configuring winget packages ---" Write-Host "===========================================" - for ($i = 0; $i -le $ProgramsToInstall.Count; $i++) { - $Program = $ProgramsToInstall[$i] + Foreach ($Program in $ProgramsToInstall){ $failedPackages = @() - Write-Progress -Activity "$manage Applications" -Status "$manage $($Program.winget) $($i + 1) of $count" -PercentComplete $(($i/$count) * 100) - if($manage -eq "Installing") { + Write-Progress -Activity "$manage Applications" -Status "$manage $($Program.winget) $($x + 1) of $count" -PercentComplete $($x/$count*100) + if($manage -eq "Installing"){ # Install package via ID, if it fails try again with different scope and then with an unelevated prompt. # Since Install-WinGetPackage might not be directly available, we use winget install command as a workaround. # Winget, not all installers honor any of the following: System-wide, User Installs, or Unelevated Prompt OR Silent Install Mode. @@ -41,24 +40,24 @@ Function Install-WinUtilProgramWinget { Write-Host "Starting install of $($Program.winget) with winget." try { $status = $(Start-Process -FilePath "winget" -ArgumentList "install --id $($Program.winget) --silent --accept-source-agreements --accept-package-agreements" -Wait -PassThru -NoNewWindow).ExitCode - if($status -eq 0) { + if($status -eq 0){ Write-Host "$($Program.winget) installed successfully." $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($x/$count) }) continue } - if ($status -eq -1978335189) { + if ($status -eq -1978335189){ Write-Host "$($Program.winget) No applicable update found" $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($x/$count) }) continue } Write-Host "Attempt with User scope" $status = $(Start-Process -FilePath "winget" -ArgumentList "install --id $($Program.winget) --scope user --silent --accept-source-agreements --accept-package-agreements" -Wait -PassThru -NoNewWindow).ExitCode - if($status -eq 0) { + if($status -eq 0){ Write-Host "$($Program.winget) installed successfully with User scope." $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($x/$count) }) continue } - if ($status -eq -1978335189) { + if ($status -eq -1978335189){ Write-Host "$($Program.winget) No applicable update found" $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($x/$count) }) continue @@ -73,12 +72,12 @@ Function Install-WinUtilProgramWinget { } else { Write-Host "Skipping installation with specific user credentials." } - if($status -eq 0) { + if($status -eq 0){ Write-Host "$($Program.winget) installed successfully with User prompt." $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($x/$count) }) continue } - if ($status -eq -1978335189) { + if ($status -eq -1978335189){ Write-Host "$($Program.winget) No applicable update found" $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($x/$count) }) continue @@ -89,11 +88,11 @@ Function Install-WinUtilProgramWinget { $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" -value ($x/$count) }) } } - elseif($manage -eq "Uninstalling") { + if($manage -eq "Uninstalling"){ # Uninstall package via ID using winget directly. try { $status = $(Start-Process -FilePath "winget" -ArgumentList "uninstall --id $($Program.winget) --silent" -Wait -PassThru -NoNewWindow).ExitCode - if($status -ne 0) { + if($status -ne 0){ Write-Host "Failed to uninstall $($Program.winget)." $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" }) } else { @@ -107,9 +106,7 @@ Function Install-WinUtilProgramWinget { } $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($x/$count) }) } - else { - throw "[Install-WinUtilProgramWinget] Invalid Value for Parameter 'manage', Provided Value is: $manage" - } + $X++ } Write-Progress -Activity "$manage Applications" -Status "Finished" -Completed return $failedPackages; diff --git a/functions/public/Invoke-WPFTweakPS7.ps1 b/functions/public/Invoke-WPFTweakPS7.ps1 index 209b71ce..ce7fc131 100644 --- a/functions/public/Invoke-WPFTweakPS7.ps1 +++ b/functions/public/Invoke-WPFTweakPS7.ps1 @@ -30,11 +30,11 @@ function Invoke-WPFTweakPS7{ Write-Host "Windows Terminal not installed. Skipping Terminal preference" return } - # Check if the Windows Terminal settings.json file exists and return if not (Prereqisite for the following code) + # Check if the Windows Terminal settings.json file exists and return if not (Prereqisite for the following code) $settingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json" if (-not (Test-Path -Path $settingsPath)){ Write-Host "Windows Terminal Settings file not found at $settingsPath" - return + return } Write-Host "Settings file found." @@ -49,5 +49,5 @@ function Invoke-WPFTweakPS7{ Write-Host "using the name attribute." } else { Write-Host "No PowerShell 7 profile found in Windows Terminal settings using the name attribute." - } + } } diff --git a/functions/public/Invoke-WPFUltimatePerformance.ps1 b/functions/public/Invoke-WPFUltimatePerformance.ps1 index 599f12df..d1a12780 100644 --- a/functions/public/Invoke-WPFUltimatePerformance.ps1 +++ b/functions/public/Invoke-WPFUltimatePerformance.ps1 @@ -33,7 +33,7 @@ Function Invoke-WPFUltimatePerformance { if ($ultimatePlan) { # Extract the GUID of the Ultimate Performance plan $ultimatePlanGUID = $ultimatePlan.Line.Split()[3] - + # Set a different power plan as active before deleting the Ultimate Performance plan $balancedPlanGUID = (powercfg -list | Select-String -Pattern "Balanced").Line.Split()[3] powercfg -setactive $balancedPlanGUID diff --git a/mkdocs.yml b/mkdocs.yml index afe7ea72..73681798 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -26,16 +26,18 @@ theme: logo: assets/favicon.png favicon: assets/favicon.png palette: - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default toggle: - icon: material/toggle-switch-off-outline + icon: material/toggle-switch-off-outline name: Switch to dark mode primary: black - accent: purple - - scheme: slate + accent: purple + - media: "(prefers-color-scheme: dark)" + scheme: slate toggle: icon: material/toggle-switch - name: Switch to light mode + name: Switch to light mode primary: teal accent: lime markdown_extensions: diff --git a/winutil.ps1 b/winutil.ps1 index 3c609c74..cab34677 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -8,7 +8,7 @@ Author : Chris Titus @christitustech Runspace Author: @DeveloperDurp GitHub : https://github.com/ChrisTitusTech - Version : 24.07.15 + Version : 24.07.17 #> param ( [switch]$Debug, @@ -45,7 +45,7 @@ Add-Type -AssemblyName System.Windows.Forms # Variable to sync between runspaces $sync = [Hashtable]::Synchronized(@{}) $sync.PSScriptRoot = $PSScriptRoot -$sync.version = "24.07.15" +$sync.version = "24.07.17" $sync.configs = @{} $sync.ProcessRunning = $false @@ -1001,18 +1001,17 @@ Function Install-WinUtilProgramWinget { [Parameter(Position=1)] [String]$manage = "Installing" ) - + $x = 0 $count = $ProgramsToInstall.Count Write-Progress -Activity "$manage Applications" -Status "Starting" -PercentComplete 0 Write-Host "===========================================" Write-Host "-- Configuring winget packages ---" Write-Host "===========================================" - for ($i = 0; $i -le $ProgramsToInstall.Count; $i++) { - $Program = $ProgramsToInstall[$i] + Foreach ($Program in $ProgramsToInstall){ $failedPackages = @() - Write-Progress -Activity "$manage Applications" -Status "$manage $($Program.winget) $($i + 1) of $count" -PercentComplete $(($i/$count) * 100) - if($manage -eq "Installing") { + Write-Progress -Activity "$manage Applications" -Status "$manage $($Program.winget) $($x + 1) of $count" -PercentComplete $($x/$count*100) + if($manage -eq "Installing"){ # Install package via ID, if it fails try again with different scope and then with an unelevated prompt. # Since Install-WinGetPackage might not be directly available, we use winget install command as a workaround. # Winget, not all installers honor any of the following: System-wide, User Installs, or Unelevated Prompt OR Silent Install Mode. @@ -1020,21 +1019,21 @@ Function Install-WinUtilProgramWinget { Write-Host "Starting install of $($Program.winget) with winget." try { $status = $(Start-Process -FilePath "winget" -ArgumentList "install --id $($Program.winget) --silent --accept-source-agreements --accept-package-agreements" -Wait -PassThru -NoNewWindow).ExitCode - if($status -eq 0) { + if($status -eq 0){ Write-Host "$($Program.winget) installed successfully." continue } - if ($status -eq -1978335189) { + if ($status -eq -1978335189){ Write-Host "$($Program.winget) No applicable update found" continue } Write-Host "Attempt with User scope" $status = $(Start-Process -FilePath "winget" -ArgumentList "install --id $($Program.winget) --scope user --silent --accept-source-agreements --accept-package-agreements" -Wait -PassThru -NoNewWindow).ExitCode - if($status -eq 0) { + if($status -eq 0){ Write-Host "$($Program.winget) installed successfully with User scope." continue } - if ($status -eq -1978335189) { + if ($status -eq -1978335189){ Write-Host "$($Program.winget) No applicable update found" continue } @@ -1048,11 +1047,11 @@ Function Install-WinUtilProgramWinget { } else { Write-Host "Skipping installation with specific user credentials." } - if($status -eq 0) { + if($status -eq 0){ Write-Host "$($Program.winget) installed successfully with User prompt." continue } - if ($status -eq -1978335189) { + if ($status -eq -1978335189){ Write-Host "$($Program.winget) No applicable update found" continue } @@ -1061,11 +1060,11 @@ Function Install-WinUtilProgramWinget { $failedPackages += $Program } } - elseif($manage -eq "Uninstalling") { + if($manage -eq "Uninstalling"){ # Uninstall package via ID using winget directly. try { $status = $(Start-Process -FilePath "winget" -ArgumentList "uninstall --id $($Program.winget) --silent" -Wait -PassThru -NoNewWindow).ExitCode - if($status -ne 0) { + if($status -ne 0){ Write-Host "Failed to uninstall $($Program.winget)." } else { Write-Host "$($Program.winget) uninstalled successfully." @@ -1076,9 +1075,7 @@ Function Install-WinUtilProgramWinget { $failedPackages += $Program } } - else { - throw "[Install-WinUtilProgramWinget] Invalid Value for Parameter 'manage', Provided Value is: $manage" - } + $X++ } Write-Progress -Activity "$manage Applications" -Status "Finished" -Completed return $failedPackages; @@ -5037,9 +5034,9 @@ function Invoke-WPFShortcut { else{ $shell = "powershell.exe" } - + $shellArgs = "-ExecutionPolicy Bypass -Command `"Start-Process $shell -verb runas -ArgumentList `'-Command `"irm https://christitus.com/win | iex`"`'" - + $DestinationName = "WinUtil.lnk" Invoke-WebRequest -Uri "https://christitus.com/images/logo-full.png" -OutFile "$env:TEMP\cttlogo.png" @@ -5184,11 +5181,11 @@ function Invoke-WPFTweakPS7{ Write-Host "Windows Terminal not installed. Skipping Terminal preference" return } - # Check if the Windows Terminal settings.json file exists and return if not (Prereqisite for the following code) + # Check if the Windows Terminal settings.json file exists and return if not (Prereqisite for the following code) $settingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json" if (-not (Test-Path -Path $settingsPath)){ Write-Host "Windows Terminal Settings file not found at $settingsPath" - return + return } Write-Host "Settings file found." @@ -5203,7 +5200,7 @@ function Invoke-WPFTweakPS7{ Write-Host "using the name attribute." } else { Write-Host "No PowerShell 7 profile found in Windows Terminal settings using the name attribute." - } + } } function Invoke-WPFtweaksbutton { <# @@ -5292,7 +5289,7 @@ Function Invoke-WPFUltimatePerformance { if ($ultimatePlan) { # Extract the GUID of the Ultimate Performance plan $ultimatePlanGUID = $ultimatePlan.Line.Split()[3] - + # Set a different power plan as active before deleting the Ultimate Performance plan $balancedPlanGUID = (powercfg -list | Select-String -Pattern "Balanced").Line.Split()[3] powercfg -setactive $balancedPlanGUID