mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-05 12:43:50 -05:00
add undoscript feature + implement it on every tweaks (#776)
* add undoscript feature + implement it on right click menu - add undoscript feature - add undo for right click menu to go back to windows 11 default right click menu by implementing undoscript feature * undoscript for WPFMiscTweaksDisplay * undoscript for WPFEssTweaksRemoveEdge * undoscript for WPFEssTweaksRemoveCortana * undoscript for WPFEssTweaksStorage * Update Invoke-WinUtilTweaks.ps1 thanks to @DeveloperDurp * compile
This commit is contained in:
@ -15,19 +15,16 @@ function Invoke-WinUtilTweaks {
|
||||
Registry = "OriginalValue"
|
||||
ScheduledTask = "OriginalState"
|
||||
Service = "OriginalType"
|
||||
ScriptType = "UndoScript"
|
||||
}
|
||||
|
||||
}
|
||||
Else{
|
||||
$Values = @{
|
||||
Registry = "Value"
|
||||
ScheduledTask = "State"
|
||||
Service = "StartupType"
|
||||
}
|
||||
}
|
||||
|
||||
if($sync.configs.tweaks.$CheckBox.registry){
|
||||
$sync.configs.tweaks.$CheckBox.registry | ForEach-Object {
|
||||
Set-WinUtilRegistry -Name $psitem.Name -Path $psitem.Path -Type $psitem.Type -Value $psitem.$($values.registry)
|
||||
ScriptType = "InvokeScript"
|
||||
}
|
||||
}
|
||||
if($sync.configs.tweaks.$CheckBox.ScheduledTask){
|
||||
@ -40,6 +37,17 @@ function Invoke-WinUtilTweaks {
|
||||
Set-WinUtilService -Name $psitem.Name -StartupType $psitem.$($values.Service)
|
||||
}
|
||||
}
|
||||
if($sync.configs.tweaks.$CheckBox.registry){
|
||||
$sync.configs.tweaks.$CheckBox.registry | ForEach-Object {
|
||||
Set-WinUtilRegistry -Name $psitem.Name -Path $psitem.Path -Type $psitem.Type -Value $psitem.$($values.registry)
|
||||
}
|
||||
}
|
||||
if($sync.configs.tweaks.$CheckBox.$($values.ScriptType)){
|
||||
$sync.configs.tweaks.$CheckBox.$($values.ScriptType) | ForEach-Object {
|
||||
$Scriptblock = [scriptblock]::Create($psitem)
|
||||
Invoke-WinUtilScript -ScriptBlock $scriptblock -Name $CheckBox
|
||||
}
|
||||
}
|
||||
|
||||
if(!$undo){
|
||||
if($sync.configs.tweaks.$CheckBox.appx){
|
||||
@ -47,11 +55,6 @@ function Invoke-WinUtilTweaks {
|
||||
Remove-WinUtilAPPX -Name $psitem
|
||||
}
|
||||
}
|
||||
if($sync.configs.tweaks.$CheckBox.InvokeScript){
|
||||
$sync.configs.tweaks.$CheckBox.InvokeScript | ForEach-Object {
|
||||
$Scriptblock = [scriptblock]::Create($psitem)
|
||||
Invoke-WinUtilScript -ScriptBlock $scriptblock -Name $CheckBox
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user