mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-05 04:33:53 -05:00
change filenames, centralize logic in Invoke-WPFOOSU
This commit is contained in:
@ -2234,7 +2234,7 @@
|
||||
"
|
||||
]
|
||||
},
|
||||
"WPFTweaksOO": {
|
||||
"WPFTweaksOOSU": {
|
||||
"Content": "Run OO Shutup",
|
||||
"Description": "Runs OO Shutup and applies the recommended Tweaks. https://www.oo-software.com/en/shutup10",
|
||||
"category": "Essential Tweaks",
|
||||
@ -2242,17 +2242,10 @@
|
||||
"Order": "a002_",
|
||||
"ToolTip": "Runs OO Shutup and applies the recommended Tweaks https://www.oo-software.com/en/shutup10",
|
||||
"InvokeScript": [
|
||||
"curl.exe -s \"https://raw.githubusercontent.com/ChrisTitusTech/winutil/main/config/recommended_ooshutup10.cfg\" -o $ENV:temp\\recommended_ooshutup10.cfg
|
||||
curl.exe -s \"https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe\" -o $ENV:temp\\OOSU10.exe
|
||||
Start-Process $ENV:temp\\OOSU10.exe -ArgumentList \"\"\"$ENV:temp\\recommended_ooshutup10.cfg\"\" /quiet\"
|
||||
Write-Host \"To modify the applied policies run $ENV:temp\\OOSU10.exe manually\" -ForegroundColor Yellow
|
||||
"
|
||||
"Invoke-WPFOOSU -action \"recommended\""
|
||||
],
|
||||
"UndoScript": [
|
||||
"curl.exe -s \"https://raw.githubusercontent.com/ChrisTitusTech/winutil/main/config/factory_ooshutup10.cfg\" -o $ENV:temp\\factory_ooshutup10.cfg
|
||||
curl.exe -s \"https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe\" -o $ENV:temp\\OOSU10.exe
|
||||
Start-Process $ENV:temp\\OOSU10.exe -ArgumentList \"\"\"$ENV:temp\\factory_ooshutup10.cfg\"\" /quiet\"
|
||||
"
|
||||
"Invoke-WPFOOSU -action \"undo\""
|
||||
]
|
||||
},
|
||||
"WPFTweaksStorage": {
|
||||
@ -2619,6 +2612,13 @@
|
||||
"Order": "a067_",
|
||||
"Type": "Toggle"
|
||||
},
|
||||
"WPFOOSUbutton": {
|
||||
"Content": "Customize OO Shutup Tweaks",
|
||||
"category": "z__Advanced Tweaks - CAUTION",
|
||||
"panel": "1",
|
||||
"Order": "a039_",
|
||||
"Type": "220"
|
||||
},
|
||||
"WPFchangedns": {
|
||||
"Content": "DNS",
|
||||
"category": "z__Advanced Tweaks - CAUTION",
|
||||
@ -2640,7 +2640,7 @@
|
||||
"panel": "1",
|
||||
"Order": "a042_",
|
||||
"Type": "160"
|
||||
},
|
||||
},
|
||||
"WPFAddUltPerf": {
|
||||
"Content": "Add and Activate Ultimate Performance Profile",
|
||||
"category": "Performance Plans",
|
||||
|
@ -27,6 +27,7 @@ function Invoke-WPFButton {
|
||||
"WPFclear" {Invoke-WPFPresets -preset $null -imported $true}
|
||||
"WPFclearWinget" {Invoke-WPFPresets -preset $null -imported $true -CheckBox "WPFInstall"}
|
||||
"WPFtweaksbutton" {Invoke-WPFtweaksbutton}
|
||||
"WPFOOSUbutton" {Invoke-WPFOOSU -action "customize"}
|
||||
"WPFAddUltPerf" {Invoke-WPFUltimatePerformance -State "Enabled"}
|
||||
"WPFRemoveUltPerf" {Invoke-WPFUltimatePerformance -State "Disabled"}
|
||||
"WPFundoall" {Invoke-WPFundoall}
|
||||
|
43
functions/public/Invoke-WPFOOSU
Normal file
43
functions/public/Invoke-WPFOOSU
Normal file
@ -0,0 +1,43 @@
|
||||
function Invoke-WPFOOSU {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Downloads and runs OO Shutup 10 with or without config files
|
||||
.PARAMETER action
|
||||
Specifies how OOSU should be started
|
||||
customize: Opens the OOSU GUI
|
||||
recommended: Loads and applies the recommended OOSU policies silently
|
||||
undo: Resets all policies to factory silently
|
||||
#>
|
||||
|
||||
param (
|
||||
[ValidateSet("customize", "recommended", "undo")]
|
||||
[string]$action
|
||||
)
|
||||
|
||||
$OOSU_filepath = "$ENV:temp\OOSU10.exe"
|
||||
|
||||
$Initial_ProgressPreference = $ProgressPreference
|
||||
$ProgressPreference = "SilentlyContinue" # Disables the Progress Bar to drasticly speed up Invoke-WebRequest
|
||||
Invoke-WebRequest -Uri "https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe" -OutFile $OOSU_filepath
|
||||
|
||||
switch ($action)
|
||||
{
|
||||
"customize"{
|
||||
Write-Host "Starting OO Shutup 10 ..."
|
||||
Start-Process $OOSU_filepath
|
||||
}
|
||||
"recommended"{
|
||||
$oosu_config = "$ENV:temp\ooshutup10_recommended.cfg"
|
||||
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/Marterich/winutil/main/config/recommended_ooshutup10.cfg" -OutFile $oosu_config
|
||||
Write-Host "Applying recommended OO Shutup 10 Policies"
|
||||
Start-Process $OOSU_filepath -ArgumentList "$oosu_config /quiet"
|
||||
}
|
||||
"undo"{
|
||||
$oosu_config = "$ENV:temp\ooshutup10_factory.cfg"
|
||||
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/Marterich/winutil/main/config/factory_ooshutup10.cfg" -OutFile $oosu_config
|
||||
Write-Host "Resetting all OO Shutup 10 Policies"
|
||||
Start-Process $OOSU_filepath -ArgumentList "$oosu_config /quiet"
|
||||
}
|
||||
}
|
||||
$ProgressPreference = $Initial_ProgressPreference
|
||||
}
|
Reference in New Issue
Block a user