winutil/functions/private/Get-WinUtilCheckBoxes.ps1
Chris Titus 075f2e9a50
Test 03 2023 (#726)
* Update inputXML.xaml

* Compile Winutil

* Update main.ps1 (#641)

Fix DarkMode

* Compile Winutil

* Compile Winutil

* Compile Winutil

* Update tweaks.json

* fix hovertime

* shortcut (#643)

add ability to create a shortcut to invoke winutil more easily

* Compile Winutil

* Tweaks Check (#646)

* Tweaks Check

Added check for no checked tweaks plus formatting

* more formating fixing

* Compile Winutil

* [ooshutup10] Fixed link to ooshutup10 settings file (#665)

* Compile Winutil

* Features Migrated to config and runspaces (#667)

* Compile Winutil

* Document Calendar Disable/Enable

Check Disable Notification and click undo tweaks to re-enable calendar

* Compile Winutil

* Update Edge_Removal.bat

* Update Edge_Removal.bat (#660)

* garbage commit - read system

Trying to read current system registry values state and do a checkbox for enabled or disabled values

* Compile Winutil

* Add Ubisoft Connect & WinRAR as install options. (#678)

* Compile Winutil

* adding the code from asheroto to install winget (#684)

* adding the code from asheroto to get winget

with Server versions of Windows, that come without winget , the script seems unable to install it and then refuses to install any programs. so by adding two lines of code (hopefully) you can include the installation of winget and then fulfill the requirement and let the program run and do all the cool things

* instaling winget from asheroto

so the script will check if winget is installed on server and LTSC versions of Windows.  and tries to install it, when for some reason it can't, then a condition on the code gets fulfilled and the function breaks, this code from the asheroto repo should, (hopefully) make it so winget can get installed and the condition is never met, therefore allowing it the script to continue

* Compile Winutil

* Add Neovim and Node Version Manager (#691)

* Compile Winutil

* Preload Winget and tweaks with already installed (#682)

* winget

* updated runspaces and winget to update gui outside of main thread

* registry check for tweaks

* add impex to winget

* add uninstall button

* tweaks done

* update tests

---------

Co-authored-by: Chris Titus <contact@christitus.com>

* Compile Winutil

* feat: add postman into developement (#695)

Co-authored-by: Chris Titus <contact@christitus.com>

* Update inputXML.xaml (#701)

Some of the items were missing WPF in the name

* Compile Winutil

* Split up AllowGameDVR to fix breaking Xbox Game Bar (#692)

* Split up AllowGameDVR to fix breaking Xbox Game Bar

* Undo changes to winutil

* Compile Winutil

* Removed Atom due to it having been sunsetted (#711)

Co-authored-by: Chris Titus <contact@christitus.com>

* Add application GeForce NOW to Applications/Games (#724)

* Compile Winutil

* Fix syntax and typo

* Compile Winutil

* Fixing Original Service Types

* Compile Winutil

* Update inputXML.xaml (#725)

Fix typo as upgrade selection will upgrade all

* Compile Winutil

---------

Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com>
Co-authored-by: DeveloperDurp <developerdurp@durp.info>
Co-authored-by: jokerwrld999 <47574931+jokerwrld999@users.noreply.github.com>
Co-authored-by: Raf <69535896+Rafee-M@users.noreply.github.com>
Co-authored-by: Jack Boecker <boeckerjack@protonmail.com>
Co-authored-by: migno_chrono <75509204+mignochrono@users.noreply.github.com>
Co-authored-by: Umair Raza <52033975+umairraza96@users.noreply.github.com>
Co-authored-by: dreamsyntax <dreamsyntax@gmail.com>
Co-authored-by: Daniel <74148862+Danulal@users.noreply.github.com>
Co-authored-by: tomgrice <tomgrice@gmail.com>
2023-05-09 13:14:27 -05:00

70 lines
2.1 KiB
PowerShell

Function Get-WinUtilCheckBoxes {
<#
.DESCRIPTION
Function is meant to find all checkboxes that are checked on the specefic tab and input them into a script.
Outputed data will be the names of the checkboxes that were checked
.EXAMPLE
Get-WinUtilCheckBoxes "WPFInstall"
#>
Param(
$Group,
[boolean]$unCheck = $true
)
$Output = New-Object System.Collections.Generic.List[System.Object]
if($Group -eq "WPFInstall"){
$filter = Get-WinUtilVariables -Type Checkbox | Where-Object {$psitem -like "WPFInstall*"}
$CheckBoxes = $sync.GetEnumerator() | Where-Object {$psitem.Key -in $filter}
Foreach ($CheckBox in $CheckBoxes){
if($CheckBox.value.ischecked -eq $true){
$sync.configs.applications.$($CheckBox.Name).winget -split ";" | ForEach-Object {
$Output.Add($psitem)
}
if ($uncheck -eq $true){
$CheckBox.value.ischecked = $false
}
}
}
}
if($Group -eq "WPFTweaks"){
$filter = Get-WinUtilVariables -Type Checkbox | Where-Object {$psitem -like "WPF*Tweaks*"}
$CheckBoxes = $sync.GetEnumerator() | Where-Object {$psitem.Key -in $filter}
Foreach ($CheckBox in $CheckBoxes){
if($CheckBox.value.ischecked -eq $true){
$Output.Add($Checkbox.Name)
if ($uncheck -eq $true){
$CheckBox.value.ischecked = $false
}
}
}
}
if($Group -eq "WPFFeature"){
$filter = Get-WinUtilVariables -Type Checkbox | Where-Object {$psitem -like "WPF*Feature*"}
$CheckBoxes = $sync.GetEnumerator() | Where-Object {$psitem.Key -in $filter}
Foreach ($CheckBox in $CheckBoxes){
if($CheckBox.value.ischecked -eq $true){
$Output.Add($Checkbox.Name)
if ($uncheck -eq $true){
$CheckBox.value.ischecked = $false
}
}
}
}
Write-Output $($Output | Select-Object -Unique)
}