winutil/functions/private/Install-WinUtilWinget.ps1

49 lines
1.6 KiB
PowerShell
Raw Normal View History

Test 2023 7 20 (#917) * Remove Edge from Start Menu and Desktop (#898) * Update edgeremoval.bat * Fix Edge not being deleted from Desktop * Compile Winutil * fix yubikey users service * Compile Winutil * AJRouter and Kiosk Disable * Compile Winutil * TermService enable This service will hang when applying tweaks. Changing to Auto from Manual * Compile Winutil * Fix bug with Telemetry Tweak services should NOT be tweaked here * dupe tweak removal * hibernate off and delete * Compile Winutil * Cleaning Windows Update Folder * Compile Winutil * GameDVR Fix * Compile Winutil * Fixed consistency in variable names and values inside edgeremoval.bat (#902) * Compile Winutil * add spdx license * Compile Winutil * Updated Dark mode check (#904) * Compile Winutil * Update Dark Mode Check updated the theme check to use the existing function * Description update Updated Description --------- Co-authored-by: DeveloperDurp <DeveloperDurp@users.noreply.github.com> * Compile Winutil * fixes #569 * Compile Winutil * Added Bing Search toggle plus some support functions (#908) * Compile Winutil * Update winget.ps1 * Compile Winutil * Fix Winget Install * Compile Winutil * Update Install-WinUtilWinget.ps1 * Compile Winutil * Update Install-WinUtilWinget.ps1 * Compile Winutil * Update Install-WinUtilWinget.ps1 * Compile Winutil * Winget fixes * Compile Winutil --------- Co-authored-by: Antun Nitraj <antnitraj@gmail.com> Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com> Co-authored-by: DeveloperDurp <developerdurp@durp.info> Co-authored-by: DeveloperDurp <DeveloperDurp@users.noreply.github.com>
2023-07-27 16:06:41 -05:00
function Get-LatestHash {
$shaUrl = ((Invoke-WebRequest $apiLatestUrl -UseBasicParsing | ConvertFrom-Json).assets | Where-Object { $_.name -match '^Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.txt$' }).browser_download_url
$shaFile = Join-Path -Path $tempFolder -ChildPath 'Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.txt'
$WebClient.DownloadFile($shaUrl, $shaFile)
Get-Content $shaFile
}
Test 12 2022 - Big Foundational Update (#637) * 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 <contact@christitus.com> * 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 <contact@christitus.com> * 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 <contact@christitus.com> * 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 <developerdurp@durp.info> Co-authored-by: Carter <60557606+Carterpersall@users.noreply.github.com> Co-authored-by: Jacobtread <33708767+jacobtread@users.noreply.github.com> Co-authored-by: jstok84 <jstok84@gmail.com> Co-authored-by: WolfBungalow <irtwit@gmail.com> Co-authored-by: Ankit Yadav <52023083+4nkitd@users.noreply.github.com> Co-authored-by: Starfiresg1 <Starfiresg1@users.noreply.github.com> 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 <ChrisTitusTech@users.noreply.github.com>
2023-03-07 14:28:00 -06:00
function Install-WinUtilWinget {
<#
.DESCRIPTION
Function is meant to ensure winget is installed
#>
Try{
Write-Host "Checking if Winget is Installed..."
if (Test-WinUtilPackageManager -winget) {
#Checks if winget executable exists and if the Windows Version is 1809 or higher
Write-Host "Winget Already Installed"
return
}
#Gets the computer's information
if ($null -eq $sync.ComputerInfo){
$ComputerInfo = Get-ComputerInfo -ErrorAction Stop
}
Else {
$ComputerInfo = $sync.ComputerInfo
}
if (($ComputerInfo.WindowsVersion) -lt "1809") {
#Checks if Windows Version is too old for winget
Write-Host "Winget is not supported on this version of Windows (Pre-1809)"
return
}
Test 2023 7 20 (#917) * Remove Edge from Start Menu and Desktop (#898) * Update edgeremoval.bat * Fix Edge not being deleted from Desktop * Compile Winutil * fix yubikey users service * Compile Winutil * AJRouter and Kiosk Disable * Compile Winutil * TermService enable This service will hang when applying tweaks. Changing to Auto from Manual * Compile Winutil * Fix bug with Telemetry Tweak services should NOT be tweaked here * dupe tweak removal * hibernate off and delete * Compile Winutil * Cleaning Windows Update Folder * Compile Winutil * GameDVR Fix * Compile Winutil * Fixed consistency in variable names and values inside edgeremoval.bat (#902) * Compile Winutil * add spdx license * Compile Winutil * Updated Dark mode check (#904) * Compile Winutil * Update Dark Mode Check updated the theme check to use the existing function * Description update Updated Description --------- Co-authored-by: DeveloperDurp <DeveloperDurp@users.noreply.github.com> * Compile Winutil * fixes #569 * Compile Winutil * Added Bing Search toggle plus some support functions (#908) * Compile Winutil * Update winget.ps1 * Compile Winutil * Fix Winget Install * Compile Winutil * Update Install-WinUtilWinget.ps1 * Compile Winutil * Update Install-WinUtilWinget.ps1 * Compile Winutil * Update Install-WinUtilWinget.ps1 * Compile Winutil * Winget fixes * Compile Winutil --------- Co-authored-by: Antun Nitraj <antnitraj@gmail.com> Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com> Co-authored-by: DeveloperDurp <developerdurp@durp.info> Co-authored-by: DeveloperDurp <DeveloperDurp@users.noreply.github.com>
2023-07-27 16:06:41 -05:00
Write-Host "Running Alternative Installer and Direct Installing"
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "irm https://raw.githubusercontent.com/ChrisTitusTech/winutil/main/winget.ps1 | iex"
Test 12 2022 - Big Foundational Update (#637) * 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 <contact@christitus.com> * 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 <contact@christitus.com> * 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 <contact@christitus.com> * 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 <developerdurp@durp.info> Co-authored-by: Carter <60557606+Carterpersall@users.noreply.github.com> Co-authored-by: Jacobtread <33708767+jacobtread@users.noreply.github.com> Co-authored-by: jstok84 <jstok84@gmail.com> Co-authored-by: WolfBungalow <irtwit@gmail.com> Co-authored-by: Ankit Yadav <52023083+4nkitd@users.noreply.github.com> Co-authored-by: Starfiresg1 <Starfiresg1@users.noreply.github.com> 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 <ChrisTitusTech@users.noreply.github.com>
2023-03-07 14:28:00 -06:00
Write-Host "Winget Installed"
}
Catch{
throw [WingetFailedInstall]::new('Failed to install')
}
}