From a1c7501b98d56c5b554f9cfe70cb5a0767385796 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Tue, 7 Mar 2023 12:28:00 -0800 Subject: [PATCH] Test 12 2022 - Big Foundational Update (#637) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix of the unit tests (#468) * fix pester tests * fix function (#467) * Cherry pick and fix helper script * remove admin check and disable * Trim Trailing Whitespace (#472) Co-authored-by: Chris Titus * Better .gitignore (#473) * add progress and add wait to start-process (#475) * Fixed Cloudflare Naming (#504) * Update winutil.ps1 * Update MainWindow.xaml * Update check for Chocolatey (#520) * Update winutil.ps1 * Update check for Chocolatey Let user decide if he wants to install Chocolatey * Update winutil.ps1 (#525) Migrate to Switch-Tab function * Update winutil.ps1 (#531) Changes to "DiagTrack" service. * add responsive winget installs (#540) * add responsive winget installs * Update winutil.ps1 fix typo * remove no longer used paramater * add golang, an installation option in development list (#542) * Updated winget functions (#543) * update functions * Update winutil.ps1 forgot triple quotes * Update winutil.ps1 fixed vscode using wrong double quotes * Functions and error handling (#552) * move winget install to function and exception * updated winget upgrade to new install process * add logging to update * choco to function and write-output to ensure logs * update error handling * revert write-host and add invoke-runspace * Added runspace to load configs in background * fix unit tests * update pester tests * update pester * update pester * update pester * updated tweaks config to use WPF variable name * Fix data type of MouseHoverTime (#568) Setting Computer\HKEY_CURRENT_USER\Control Panel\Mouse\MouseHoverTime needs to be REG_SZ instead of REG_DWORD. With the wrong type the Taskbar and the Start Menu become hard to use because everything pops up instantly, probably because it's then treated as a 0 ms delay. * fix restore launch to quick access & OOSU10 download (#565) * Fix grammar (#577) * Update MainWindow.xaml * Update MainWindow-runspace.xaml * fix enable numlock after startup (#580) * Update README.md (#616) Added DNS provider into readme * Fix O&O ShutUp10 disabling app notifications and hide search box (#630) * Add files via upload Added ooshutup10_winutil_settings and fix the issue where OOSU10 disable app notifications and hide search box in windows. * Update winutil.ps1 Change ooshut10.cfg to ooshutup10_winutil_settings.cfg and fix the issues in https://github.com/ChrisTitusTech/winutil/issues/629 Now when apply the tweaks by O&O ShutUp10, will keep search box and notifications will not be disabled. * Update winutil.ps1 * Update winutil.ps1 --------- Co-authored-by: Chris Titus * Create ooshutup10_winutil_settings.cfg * Feature/tweakstofunctions (#576) * add functions for services * Move WPFEssTweaksDVR to function * Add invoke script and moved temp files * WPFEssTweaksHiber and formatting * WPFEssTweaksHiber * WPFEssTweaksHome and service * WPFEssTweaksLoc * TPMCheck * WPFEssTweaksDiskCleanup * Add error handling for invoke script * grammer * UAC and tweaks * WPFMiscTweaksDisableNotifications * WPFMiscTweaksRightClickMenu * Added DNS configuration + Reset to DHCP * WPFEssTweaksOO * WPFEssTweaksRP * WPFEssTweaksServices * WPFEssTweaksStorage * WPFEssTweaksTele * WPFEssTweaksWifi * WPFMiscTweaksLapPower * WPFMiscTweaksLapNum * WPFMiscTweaksPower * WPFMiscTweaksNum * WPFMiscTweaksExt * WPFMiscTweaksUTC * WPFMiscTweaksDisplay * Mouse Acceleration * WPFEssTweaksRemoveCortana * WPFEssTweaksDeBloat * set teaks to get checkboxes and loop * remove isdev * add help documentation * Add Quad 9 for #532 and #416 * remove isdev * Update tweaks.json Remove-ItemProperty is no longer needed as this was a bug from a bad commit 4 months ago. --------- Co-authored-by: Chris Titus * Tweak bingsearch (#620) * add functions for services * Move WPFEssTweaksDVR to function * Add invoke script and moved temp files * WPFEssTweaksHiber and formatting * WPFEssTweaksHiber * WPFEssTweaksHome and service * WPFEssTweaksLoc * TPMCheck * WPFEssTweaksDiskCleanup * Add error handling for invoke script * grammer * UAC and tweaks * WPFMiscTweaksDisableNotifications * WPFMiscTweaksRightClickMenu * Added DNS configuration + Reset to DHCP * WPFEssTweaksOO * WPFEssTweaksRP * WPFEssTweaksServices * WPFEssTweaksStorage * WPFEssTweaksTele * WPFEssTweaksWifi * WPFMiscTweaksLapPower * WPFMiscTweaksLapNum * WPFMiscTweaksPower * WPFMiscTweaksNum * WPFMiscTweaksExt * WPFMiscTweaksUTC * WPFMiscTweaksDisplay * Mouse Acceleration * WPFEssTweaksRemoveCortana * WPFEssTweaksDeBloat * set teaks to get checkboxes and loop * remove isdev * add help documentation * Add Quad 9 for #532 and #416 * remove isdev * Update helper script and add tweak * update changes * Refactor/runspaces (#626) * modify runspace.ps1 to compile * update compiler to include warning * unit test * implement invoke-button and naming standard * naming standard * fix winutil tests * update functions * add version number * fix codeowners * fix import * undo tweaks now pull from config * pester test * Compile Winutil * python and oo cfg -fix python 3 to 3.11 -fix o&o shutup cfg -enable dev mode for testing * Force install missing winget Fix method for winget install on any system. * Deluge Addition * Feature/impex (#619) * add functions for services * Move WPFEssTweaksDVR to function * Add invoke script and moved temp files * WPFEssTweaksHiber and formatting * WPFEssTweaksHiber * WPFEssTweaksHome and service * WPFEssTweaksLoc * TPMCheck * WPFEssTweaksDiskCleanup * Add error handling for invoke script * grammer * UAC and tweaks * WPFMiscTweaksDisableNotifications * WPFMiscTweaksRightClickMenu * Added DNS configuration + Reset to DHCP * WPFEssTweaksOO * WPFEssTweaksRP * WPFEssTweaksServices * WPFEssTweaksStorage * WPFEssTweaksTele * WPFEssTweaksWifi * WPFMiscTweaksLapPower * WPFMiscTweaksLapNum * WPFMiscTweaksPower * WPFMiscTweaksNum * WPFMiscTweaksExt * WPFMiscTweaksUTC * WPFMiscTweaksDisplay * Mouse Acceleration * WPFEssTweaksRemoveCortana * WPFEssTweaksDeBloat * set teaks to get checkboxes and loop * remove isdev * add help documentation * Add Quad 9 for #532 and #416 * remove isdev * Working Import and Export * Add null check * Remove IsDev * sync with test * redo impex * Irm runspace fix (#635) * Update runspace.ps1 * Update start.ps1 * compiled for testing * Compile Winutil * Compile Winutil * test * disable runspace build * test * change compile to ascii * change compile to winutil * Compile Winutil * Delete MainWindow.xaml * Update release.yaml runspace merge job * remove update branch --------- Co-authored-by: DeveloperDurp Co-authored-by: Carter <60557606+Carterpersall@users.noreply.github.com> Co-authored-by: Jacobtread <33708767+jacobtread@users.noreply.github.com> Co-authored-by: jstok84 Co-authored-by: WolfBungalow Co-authored-by: Ankit Yadav <52023083+4nkitd@users.noreply.github.com> Co-authored-by: Starfiresg1 Co-authored-by: Adrián Insaurralde Avalos <36372335+adrianinsaval@users.noreply.github.com> Co-authored-by: Hyperio <96462198+hyperio546@users.noreply.github.com> Co-authored-by: dennyamarojr <36896116+dennyamarojr@users.noreply.github.com> Co-authored-by: ChrisTitusTech --- .github/CODEOWNERS | 59 + .github/workflows/release.yaml | 13 +- .github/workflows/unittests.yaml | 13 + .gitignore | 43 +- Compile.ps1 | 33 + MainWindow-runspace.xaml | 305 - README.md | 1 + config/applications.json | 10 +- config/dns.json | 30 + config/helperscript.ps1 | 94 +- config/tweaks.json | 451 +- functions/private/Get-WinUtilCheckBoxes.ps1 | 52 + functions/private/Get-WinUtilDarkMode.ps1 | 16 + .../private/Get-WinUtilInstallerProcess.ps1 | 18 + functions/private/Install-WinUtilChoco.ps1 | 30 + .../private/Install-WinUtilProgramWinget.ps1 | 28 + functions/private/Install-WinUtilWinget.ps1 | 68 + functions/private/Invoke-WinUtilScript.ps1 | 26 + functions/private/Invoke-WinUtilTweaks.ps1 | 57 + functions/private/Remove-WinUtilAPPX.ps1 | 34 + functions/private/Set-WinUtilDNS.ps1 | 32 + functions/private/Set-WinUtilRegistry.ps1 | 40 + .../private/Set-WinUtilScheduledTask.ps1 | 40 + functions/private/Set-WinUtilService.ps1 | 43 + .../private/Test-WinUtilPackageManager.ps1 | 27 + .../private/Update-WinUtilProgramWinget.ps1 | 22 + functions/public/Invoke-WPFButton.ps1 | 49 + functions/public/Invoke-WPFControlPanel.ps1 | 18 + functions/public/Invoke-WPFDarkMode.ps1 | 33 + functions/public/Invoke-WPFFeatureInstall.ps1 | 56 + functions/public/Invoke-WPFFixesUpdate.ps1 | 111 + functions/public/Invoke-WPFFormVariables.ps1 | 37 + functions/public/Invoke-WPFImpex.ps1 | 37 + functions/public/Invoke-WPFInstall.ps1 | 52 + functions/public/Invoke-WPFInstallUpgrade.ps1 | 27 + functions/public/Invoke-WPFPanelAutologin.ps1 | 10 + functions/public/Invoke-WPFPanelDISM.ps1 | 13 + functions/public/Invoke-WPFPresets.ps1 | 31 + functions/public/Invoke-WPFRunspace.ps1 | 73 + functions/public/Invoke-WPFTab.ps1 | 24 + .../public/Invoke-WPFUltimatePerformance.ps1 | 30 + functions/public/Invoke-WPFUpdatesdefault.ps1 | 45 + functions/public/Invoke-WPFUpdatesdisable.ps1 | 32 + .../public/Invoke-WPFUpdatessecurity.ps1 | 43 + functions/public/Invoke-WPFtweaksbutton.ps1 | 40 + functions/public/Invoke-WPFundoall.ps1 | 190 + lint/PSScriptAnalyser.ps1 | 25 + ooshutup10_winutil_settings.cfg | 237 + pester/runspace.Tests.ps1 | 115 + pester/winutil.Tests.ps1 | 91 +- runspace.ps1 | 1529 ----- scripts/main.ps1 | 87 + scripts/start.ps1 | 19 + winutil.ps1 | 5203 ++++++++++++----- MainWindow.xaml => xaml/inputXML.xaml | 35 +- 55 files changed, 6392 insertions(+), 3485 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 Compile.ps1 delete mode 100644 MainWindow-runspace.xaml create mode 100644 config/dns.json create mode 100644 functions/private/Get-WinUtilCheckBoxes.ps1 create mode 100644 functions/private/Get-WinUtilDarkMode.ps1 create mode 100644 functions/private/Get-WinUtilInstallerProcess.ps1 create mode 100644 functions/private/Install-WinUtilChoco.ps1 create mode 100644 functions/private/Install-WinUtilProgramWinget.ps1 create mode 100644 functions/private/Install-WinUtilWinget.ps1 create mode 100644 functions/private/Invoke-WinUtilScript.ps1 create mode 100644 functions/private/Invoke-WinUtilTweaks.ps1 create mode 100644 functions/private/Remove-WinUtilAPPX.ps1 create mode 100644 functions/private/Set-WinUtilDNS.ps1 create mode 100644 functions/private/Set-WinUtilRegistry.ps1 create mode 100644 functions/private/Set-WinUtilScheduledTask.ps1 create mode 100644 functions/private/Set-WinUtilService.ps1 create mode 100644 functions/private/Test-WinUtilPackageManager.ps1 create mode 100644 functions/private/Update-WinUtilProgramWinget.ps1 create mode 100644 functions/public/Invoke-WPFButton.ps1 create mode 100644 functions/public/Invoke-WPFControlPanel.ps1 create mode 100644 functions/public/Invoke-WPFDarkMode.ps1 create mode 100644 functions/public/Invoke-WPFFeatureInstall.ps1 create mode 100644 functions/public/Invoke-WPFFixesUpdate.ps1 create mode 100644 functions/public/Invoke-WPFFormVariables.ps1 create mode 100644 functions/public/Invoke-WPFImpex.ps1 create mode 100644 functions/public/Invoke-WPFInstall.ps1 create mode 100644 functions/public/Invoke-WPFInstallUpgrade.ps1 create mode 100644 functions/public/Invoke-WPFPanelAutologin.ps1 create mode 100644 functions/public/Invoke-WPFPanelDISM.ps1 create mode 100644 functions/public/Invoke-WPFPresets.ps1 create mode 100644 functions/public/Invoke-WPFRunspace.ps1 create mode 100644 functions/public/Invoke-WPFTab.ps1 create mode 100644 functions/public/Invoke-WPFUltimatePerformance.ps1 create mode 100644 functions/public/Invoke-WPFUpdatesdefault.ps1 create mode 100644 functions/public/Invoke-WPFUpdatesdisable.ps1 create mode 100644 functions/public/Invoke-WPFUpdatessecurity.ps1 create mode 100644 functions/public/Invoke-WPFtweaksbutton.ps1 create mode 100644 functions/public/Invoke-WPFundoall.ps1 create mode 100644 lint/PSScriptAnalyser.ps1 create mode 100644 ooshutup10_winutil_settings.cfg create mode 100644 pester/runspace.Tests.ps1 delete mode 100644 runspace.ps1 create mode 100644 scripts/main.ps1 create mode 100644 scripts/start.ps1 rename MainWindow.xaml => xaml/inputXML.xaml (95%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..2a267c93 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,59 @@ +# This is a comment. +# Each line is a file pattern followed by one or more owners. + +# These owners will be the default owners for everything in +# the repo. Unless a later match takes precedence, +# @global-owner1 and @global-owner2 will be requested for +# review when someone opens a pull request. +* @ChrisTitusTech + +# Order is important; the last matching pattern takes the most +# precedence. When someone opens a pull request that only +# modifies JS files, only @js-owner and not the global +# owner(s) will be requested for a review. +# *.js @js-owner #This is an inline comment. + +# You can also use email addresses if you prefer. They'll be +# used to look up users just like we do for commit author +# emails. +# *.go docs@example.com + +# Teams can be specified as code owners as well. Teams should +# be identified in the format @org/team-name. Teams must have +# explicit write access to the repository. In this example, +# the octocats team in the octo-org organization owns all .txt files. +# *.txt @octo-org/octocats + +# In this example, @doctocat owns any files in the build/logs +# directory at the root of the repository and any of its +# subdirectories. +# /build/logs/ @doctocat + +# The `docs/*` pattern will match files like +# `docs/getting-started.md` but not further nested files like +# `docs/build-app/troubleshooting.md`. +# docs/* docs@example.com + +# In this example, @octocat owns any file in an apps directory +# anywhere in your repository. +# apps/ @octocat + +# In this example, @doctocat owns any file in the `/docs` +# directory in the root of your repository and any of its +# subdirectories. +# /docs/ @doctocat + +# In this example, any change inside the `/scripts` directory +# will require approval from @doctocat or @octocat. +# /scripts/ @doctocat @octocat + +# In this example, @octocat owns any file in a `/logs` directory such as +# `/build/logs`, `/scripts/logs`, and `/deeply/nested/logs`. Any changes +# in a `/logs` directory will require approval from @octocat. +# **/logs @octocat + +# In this example, @octocat owns any file in the `/apps` +# directory in the root of your repository except for the `/apps/github` +# subdirectory, as its owners are left empty. +# /apps/ @octocat +# /apps/github \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 66d0120d..1f73b1f7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,21 +4,18 @@ on: push: branches: - main - - test + - test* jobs: - build: - runs-on: ubuntu-latest + build-runspace: + runs-on: windows-latest steps: - uses: actions/checkout@v3 with: ref: ${{ github.head_ref }} - name: Create local changes run: | - sed -i "/\$BranchToUse = /c\$BranchToUse = '$GITHUB_REF_NAME'" $GITHUB_WORKSPACE/runspace.ps1 - grep "\$BranchToUse =" $GITHUB_WORKSPACE/runspace.ps1 - sed -i "/\$BranchToUse = /c\$BranchToUse = '$GITHUB_REF_NAME'" $GITHUB_WORKSPACE/winutil.ps1 - grep "\$BranchToUse =" $GITHUB_WORKSPACE/winutil.ps1 + powershell.exe -f Compile.ps1 - uses: stefanzweifel/git-auto-commit-action@v4 with: - commit_message: Update Branch in script + commit_message: Compile Winutil \ No newline at end of file diff --git a/.github/workflows/unittests.yaml b/.github/workflows/unittests.yaml index 273c4a3f..e7dd5723 100644 --- a/.github/workflows/unittests.yaml +++ b/.github/workflows/unittests.yaml @@ -4,6 +4,19 @@ on: push: jobs: + lint: + name: PS Script Analyzer + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: lint + uses: devblackops/github-action-psscriptanalyzer@master + with: + sendComment: false + settingsPath: lint/PSScriptAnalyser.ps1 + failOnErrors: false + failOnWarnings: false + failOnInfos: false test: runs-on: windows-latest steps: diff --git a/.gitignore b/.gitignore index af9d3355..b1f1a5bf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,38 @@ +### VSCode ### -ooshutup10.cfg -OOSU10.exe +# Configuration folder +.vscode/ + +### Visual Studio ### + +# Visual Studio user-specific files +.vs/ + +winutil.pdb + +### Windows ### + +# Folder config file +[Dd]esktop.ini + +# Executables and Configs *.exe +winget.msixbundle +pester.ps1 +*.psd* +ooshutup10.cfg +winutil.exe.config +Microsoft.UI.Xaml* +license1.xml + +# Libraries System.Management.Automation.dll Microsoft.PowerShell.ConsoleHost.dll -winutil.exe.config -winutil.pdb + +# Compressed files *.zip -.vs/ -*.psd* -pester.ps1 -Microsoft.UI.Xaml* -winget.msixbundle -license1.xml \ No newline at end of file + +### MacOS ### + +# General +.DS_Store \ No newline at end of file diff --git a/Compile.ps1 b/Compile.ps1 new file mode 100644 index 00000000..38b32a9b --- /dev/null +++ b/Compile.ps1 @@ -0,0 +1,33 @@ +$OFS = "`r`n" +$scriptname = "winutil.ps1" + + +Remove-Item .\$scriptname + +Write-output ' +################################################################################################################ +### ### +### WARNING: This file is automatically generated DO NOT modify this file directly as it will be overwritten ### +### ### +################################################################################################################ +' | Out-File ./$scriptname -Append -Encoding ascii + +(Get-Content .\scripts\start.ps1).replace('#{replaceme}',"$(get-date -format yy.MM.dd)") | Out-File ./$scriptname -Append -Encoding ascii + +Get-ChildItem .\functions -Recurse -File | ForEach-Object { + Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii +} + +Get-ChildItem .\xaml | ForEach-Object { + $xaml = (Get-Content $psitem.FullName).replace("'","''") + + Write-output "`$$($psitem.BaseName) = '$xaml'" | Out-File ./$scriptname -Append -Encoding ascii +} + +Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object { + $json = (Get-Content $psitem.FullName).replace("'","''") + + Write-output "`$sync.configs.$($psitem.BaseName) = '$json' `| convertfrom-json" | Out-File ./$scriptname -Append -Encoding ascii +} + +Get-Content .\scripts\main.ps1 | Out-File ./$scriptname -Append -Encoding ascii diff --git a/MainWindow-runspace.xaml b/MainWindow-runspace.xaml deleted file mode 100644 index 9f819aed..00000000 --- a/MainWindow-runspace.xaml +++ /dev/null @@ -1,305 +0,0 @@ - - - - - - - - - - - - - -