Compare commits

..

10 Commits

Author SHA1 Message Date
CodingWonders
cfaf139a6a [Tweaks] Conditionally determine when to use sc and Set-Service (#3761)
* [Tweaks] Conditionally determine when to use sc and Set-Service

* Clean up comments in Set-WinUtilService.ps1

Removed comments explaining the handling of auto delayed start for PWSH 5.

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2025-12-01 14:29:27 -06:00
Chris Titus Tech
becfba603d clean up spacing 2025-12-01 07:49:40 -06:00
makhlwf
2b68976e7b feat(accessibility): add accessibility labels to tweaks ui (#3731) 2025-12-01 13:45:58 -06:00
Gabi
5369d9d99b Add Create Issue (#3729) 2025-12-01 13:41:59 -06:00
Gabi
8b3e1280df Update-WPFTweaksDeBloat (#3709)
* Update tweaks.json

* Update tweaks.json

* Update tweaks.json

* Update tweaks.json

* Update tweaks.json

* Added comments to InvokeScript of WPFTweaksDeBloat

* Update tweaks.json

* Update tweaks.json
2025-12-01 13:41:28 -06:00
Alvaro Parker
ce77be324b Add zed to applications (#3734) 2025-12-01 13:31:44 -06:00
Soumyadip Nayak
6168e93d4c Remove deprecated CryptoWalletEnabled policy from Edge debloat tweaks (#3737) 2025-12-01 13:29:59 -06:00
Younes Aassila
d98118e322 Fix #3736 (#3748) 2025-12-01 13:26:21 -06:00
dependabot[bot]
f69f107d9d Bump actions/checkout from 5 to 6 (#3745)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-01 13:20:16 -06:00
Gabi
f3c3613d26 OneDrive Removal Updated, read description (#3659)
* Update tweaks.json

* Update tweaks.json

* Update tweaks.json

* Remove Unneccary -ErrorAction in OneDrive-Removal

* Format fixes for WPFTweaksRemoveOnedrive
2025-12-01 13:18:08 -06:00
12 changed files with 40 additions and 138 deletions

View File

@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Check if PR was merged - name: Check if PR was merged
if: github.event.pull_request.merged == true if: github.event.pull_request.merged == true

View File

@@ -13,7 +13,7 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- name: Checkout Sources - name: Checkout Sources
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Compile and Syntaxcheck winutil.ps1 - name: Compile and Syntaxcheck winutil.ps1
shell: pwsh shell: pwsh

View File

@@ -14,7 +14,7 @@ jobs:
CERTIFICATE_BASE64: ${{ secrets.CERTIFICATE_BASE64 }} CERTIFICATE_BASE64: ${{ secrets.CERTIFICATE_BASE64 }}
steps: steps:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Compile project - name: Compile project
shell: pwsh shell: pwsh

View File

@@ -11,7 +11,7 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Check if winutil.ps1 exists - name: Check if winutil.ps1 exists
id: check_existence id: check_existence

View File

@@ -11,7 +11,7 @@ jobs:
if: (github.event_name == 'schedule' && github.repository == 'ChrisTitusTech/winutil') || (github.event_name != 'schedule') if: (github.event_name == 'schedule' && github.repository == 'ChrisTitusTech/winutil') || (github.event_name != 'schedule')
steps: steps:
- name: Checkout 🛎️ - name: Checkout 🛎️
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Generate Sponsors 💖 - name: Generate Sponsors 💖
uses: JamesIves/github-sponsors-readme-action@v1 uses: JamesIves/github-sponsors-readme-action@v1

View File

@@ -8,7 +8,7 @@ jobs:
name: PS Script Analyzer name: PS Script Analyzer
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- name: lint - name: lint
uses: devblackops/github-action-psscriptanalyzer@master uses: devblackops/github-action-psscriptanalyzer@master
with: with:
@@ -22,7 +22,7 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Install Pester - name: Install Pester
run: | run: |

View File

@@ -35,7 +35,7 @@ irm "https://christitus.com/win" | iex
irm "https://christitus.com/windev" | iex irm "https://christitus.com/windev" | iex
``` ```
If you have Issues, refer to [Known Issues](https://winutil.christitus.com/knownissues/) If you have Issues, refer to [Known Issues](https://winutil.christitus.com/knownissues/) or [Create Issue](https://github.com/ChrisTitusTech/winutil/issues)
## 🎓 Documentation ## 🎓 Documentation

View File

@@ -2927,5 +2927,13 @@
"description": "The modern, privacy-focused, performance-driven browser built on Firefox", "description": "The modern, privacy-focused, performance-driven browser built on Firefox",
"link": "https://zen-browser.app/", "link": "https://zen-browser.app/",
"winget": "Zen-Team.Zen-Browser" "winget": "Zen-Team.Zen-Browser"
},
"Zed": {
"category": "Development",
"choco": "na",
"content": "Zed",
"description": "Zed is a modern, high-performance code editor designed from the ground up for speed and collaboration.",
"link": "https://zed.dev/",
"winget": "Zed.Zed"
} }
} }

View File

@@ -1673,13 +1673,6 @@
"Value": "0", "Value": "0",
"OriginalValue": "<RemoveEntry>" "OriginalValue": "<RemoveEntry>"
}, },
{
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
"Name": "CryptoWalletEnabled",
"Type": "DWord",
"Value": "0",
"OriginalValue": "<RemoveEntry>"
},
{ {
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge", "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
"Name": "WalletDonationEnabled", "Name": "WalletDonationEnabled",
@@ -2328,6 +2321,7 @@
"Microsoft.ZuneMusic", "Microsoft.ZuneMusic",
"Microsoft.ZuneVideo", "Microsoft.ZuneVideo",
"Microsoft.MicrosoftOfficeHub", "Microsoft.MicrosoftOfficeHub",
"MsTeams",
"*EclipseManager*", "*EclipseManager*",
"*ActiproSoftwareLLC*", "*ActiproSoftwareLLC*",
"*AdobeSystemsIncorporated.AdobePhotoshopExpress*", "*AdobeSystemsIncorporated.AdobePhotoshopExpress*",
@@ -2357,38 +2351,15 @@
], ],
"InvokeScript": [ "InvokeScript": [
" "
$TeamsPath = [System.IO.Path]::Combine($env:LOCALAPPDATA, 'Microsoft', 'Teams') $TeamsPath = \"$Env:LocalAppData\\Microsoft\\Teams\\Update.exe\"
$TeamsUpdateExePath = [System.IO.Path]::Combine($TeamsPath, 'Update.exe')
Write-Host \"Stopping Teams process...\" if (Test-Path $TeamsPath) {
Stop-Process -Name \"*teams*\" -Force -ErrorAction SilentlyContinue Write-Host \"Uninstalling Teams\"
Start-Process $TeamsPath -ArgumentList -uninstall -wait
Write-Host \"Uninstalling Teams from AppData\\Microsoft\\Teams\"
if ([System.IO.File]::Exists($TeamsUpdateExePath)) {
# Uninstall app
$proc = Start-Process $TeamsUpdateExePath \"-uninstall -s\" -PassThru
$proc.WaitForExit()
}
Write-Host \"Removing Teams AppxPackage...\"
Get-AppxPackage \"*Teams*\" | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage \"*Teams*\" -AllUsers | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue
Write-Host \"Deleting Teams directory\" Write-Host \"Deleting Teams directory\"
if ([System.IO.Directory]::Exists($TeamsPath)) { Remove-Item $TeamsPath -Recurse -Force
Remove-Item $TeamsPath -Force -Recurse -ErrorAction SilentlyContinue }
}
Write-Host \"Deleting Teams uninstall registry key\"
# Uninstall from Uninstall registry key UninstallString
$us = (Get-ChildItem -Path HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall, HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall | Get-ItemProperty | Where-Object { $_.DisplayName -like '*Teams*'}).UninstallString
if ($us.Length -gt 0) {
$us = ($us.Replace('/I', '/uninstall ') + ' /quiet').Replace(' ', ' ')
$FilePath = ($us.Substring(0, $us.IndexOf('.exe') + 4).Trim())
$ProcessArgs = ($us.Substring($us.IndexOf('.exe') + 5).Trim().replace(' ', ' '))
$proc = Start-Process -FilePath $FilePath -Args $ProcessArgs -PassThru
$proc.WaitForExit()
}
" "
], ],
"link": "https://winutil.christitus.com/dev/tweaks/z--advanced-tweaks---caution/debloat" "link": "https://winutil.christitus.com/dev/tweaks/z--advanced-tweaks---caution/debloat"
@@ -2714,95 +2685,12 @@
"Order": "a031_", "Order": "a031_",
"InvokeScript": [ "InvokeScript": [
" "
$OneDrivePath = $($env:OneDrive) Write-Host \"Uninstalling OneDrive\"
Write-Host \"Removing OneDrive\" Start-Process \"$env:SystemRoot\\System32\\OneDriveSetup.exe\" -ArgumentList /uninstall -NoNewWindow -Wait
# Check both traditional and Microsoft Store installations Write-Host \"Removing OneDrive leftovers\"
$regPath = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OneDriveSetup.exe\" Remove-Item \"$env:LocalAppData\\Microsoft\\OneDrive\" -Recurse -Force
$msStorePath = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Appx\\AppxAllUserStore\\Applications\\*OneDrive*\" Remove-Item \"$env:ProgramData\\Microsoft OneDrive\" -Recurse -Force
if (Test-Path $regPath) {
$OneDriveUninstallString = Get-ItemPropertyValue \"$regPath\" -Name \"UninstallString\"
$OneDriveExe, $OneDriveArgs = $OneDriveUninstallString.Split(\" \")
Start-Process -FilePath $OneDriveExe -ArgumentList \"$OneDriveArgs /silent\" -NoNewWindow -Wait
} elseif (Test-Path $msStorePath) {
Write-Host \"OneDrive appears to be installed via Microsoft Store\" -ForegroundColor Yellow
# Attempt to uninstall via winget
Start-Process -FilePath winget -ArgumentList \"uninstall -e --purge --accept-source-agreements Microsoft.OneDrive\" -NoNewWindow -Wait
} else {
Write-Host \"OneDrive doesn't seem to be installed\" -ForegroundColor Red
Write-Host \"Running cleanup if OneDrive path exists\" -ForegroundColor Red
}
# Check if OneDrive got Uninstalled (both paths)
if (Test-Path $OneDrivePath) {
Write-Host \"Copy downloaded Files from the OneDrive Folder to Root UserProfile\"
Start-Process -FilePath powershell -ArgumentList \"robocopy '$($OneDrivePath)' '$($env:USERPROFILE.TrimEnd())\\' /mov /e /xj\" -NoNewWindow -Wait
Write-Host \"Removing OneDrive leftovers\"
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$env:localappdata\\Microsoft\\OneDrive\"
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$env:localappdata\\OneDrive\"
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$env:programdata\\Microsoft OneDrive\"
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$env:systemdrive\\OneDriveTemp\"
reg delete \"HKEY_CURRENT_USER\\Software\\Microsoft\\OneDrive\" -f
# check if directory is empty before removing:
If ((Get-ChildItem \"$OneDrivePath\" -Recurse | Measure-Object).Count -eq 0) {
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$OneDrivePath\"
}
Write-Host \"Remove Onedrive from Explorer sidebar\"
Set-ItemProperty -Path \"HKCR:\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" -Name \"System.IsPinnedToNameSpaceTree\" -Value 0
Set-ItemProperty -Path \"HKCR:\\Wow6432Node\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" -Name \"System.IsPinnedToNameSpaceTree\" -Value 0
Write-Host \"Removing run hook for new users\"
reg load \"hku\\Default\" \"C:\\Users\\Default\\NTUSER.DAT\"
reg delete \"HKEY_USERS\\Default\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\" /v \"OneDriveSetup\" /f
reg unload \"hku\\Default\"
Write-Host \"Removing autostart key\"
reg delete \"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\" /v \"OneDrive\" /f
Write-Host \"Removing startmenu entry\"
Remove-Item -Force -ErrorAction SilentlyContinue \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\OneDrive.lnk\"
Write-Host \"Removing scheduled task\"
Get-ScheduledTask -TaskPath '\\' -TaskName 'OneDrive*' -ea SilentlyContinue | Unregister-ScheduledTask -Confirm:$false
# Add Shell folders restoring default locations
Write-Host \"Shell Fixing\"
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"AppData\" -Value \"$env:userprofile\\AppData\\Roaming\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Cache\" -Value \"$env:userprofile\\AppData\\Local\\Microsoft\\Windows\\INetCache\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Cookies\" -Value \"$env:userprofile\\AppData\\Local\\Microsoft\\Windows\\INetCookies\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Favorites\" -Value \"$env:userprofile\\Favorites\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"History\" -Value \"$env:userprofile\\AppData\\Local\\Microsoft\\Windows\\History\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Local AppData\" -Value \"$env:userprofile\\AppData\\Local\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"My Music\" -Value \"$env:userprofile\\Music\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"My Video\" -Value \"$env:userprofile\\Videos\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"NetHood\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Network Shortcuts\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"PrintHood\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Printer Shortcuts\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Programs\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Recent\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Recent\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"SendTo\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\SendTo\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Start Menu\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Startup\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Templates\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Templates\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"{374DE290-123F-4565-9164-39C4925E467B}\" -Value \"$env:userprofile\\Downloads\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Desktop\" -Value \"$env:userprofile\\Desktop\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"My Pictures\" -Value \"$env:userprofile\\Pictures\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Personal\" -Value \"$env:userprofile\\Documents\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"{F42EE2D3-909F-4907-8871-4C22FC0BF756}\" -Value \"$env:userprofile\\Documents\" -Type ExpandString
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"{0DDD015D-B06C-45D5-8C4C-F59713854639}\" -Value \"$env:userprofile\\Pictures\" -Type ExpandString
Write-Host \"Restarting explorer\"
taskkill.exe /F /IM \"explorer.exe\"
Start-Process \"explorer.exe\"
Write-Host \"Waiting for Explorer to complete loading\"
Write-Host \"Please Note - The OneDrive folder at $OneDrivePath may still have items in it. You must manually delete it, but all the files should already be copied to the base user folder.\"
Write-Host \"If there are Files missing afterwards, please Login to Onedrive.com and Download them manually\" -ForegroundColor Yellow
Start-Sleep 5
} else {
Write-Host \"Nothing to Cleanup with OneDrive\" -ForegroundColor Red
}
" "
], ],
"UndoScript": [ "UndoScript": [

View File

@@ -21,10 +21,6 @@ function Invoke-WinUtilTweaks {
$KeepServiceStartup = $true $KeepServiceStartup = $true
) )
if ($Checkbox -like "*Toggle*") {
$CheckBox = $sync.configs.tweaks.$CheckBox
}
Write-Debug "Tweaks: $($CheckBox)" Write-Debug "Tweaks: $($CheckBox)"
if($undo) { if($undo) {
$Values = @{ $Values = @{

View File

@@ -24,8 +24,12 @@ Function Set-WinUtilService {
# Check if the service exists # Check if the service exists
$service = Get-Service -Name $Name -ErrorAction Stop $service = Get-Service -Name $Name -ErrorAction Stop
# Service exists, proceed with changing properties # Service exists, proceed with changing properties -- while handling auto delayed start for PWSH 5
$service | Set-Service -StartupType $StartupType -ErrorAction Stop if (($PSVersionTable.PSVersion.Major -lt 7) -and ($StartupType -eq "AutomaticDelayedStart")) {
sc.exe config $Name start=delayed-auto
} else {
$service | Set-Service -StartupType $StartupType -ErrorAction Stop
}
} catch [System.ServiceProcess.ServiceNotFoundException] { } catch [System.ServiceProcess.ServiceNotFoundException] {
Write-Warning "Service $Name was not found" Write-Warning "Service $Name was not found"
} catch { } catch {

View File

@@ -156,6 +156,7 @@ function Invoke-WPFUIElements {
$checkBox.Name = $entryInfo.Name $checkBox.Name = $entryInfo.Name
$checkBox.HorizontalAlignment = "Right" $checkBox.HorizontalAlignment = "Right"
$checkBox.UseLayoutRounding = $true $checkBox.UseLayoutRounding = $true
[System.Windows.Automation.AutomationProperties]::SetName($checkBox, $entryInfo.Content)
$dockPanel.Children.Add($checkBox) | Out-Null $dockPanel.Children.Add($checkBox) | Out-Null
$checkBox.Style = $ColorfulToggleSwitchStyle $checkBox.Style = $ColorfulToggleSwitchStyle
@@ -191,6 +192,7 @@ function Invoke-WPFUIElements {
$toggleButton.ToolTip = $entryInfo.Description $toggleButton.ToolTip = $entryInfo.Description
$toggleButton.HorizontalAlignment = "Left" $toggleButton.HorizontalAlignment = "Left"
$toggleButton.Style = $ToggleButtonStyle $toggleButton.Style = $ToggleButtonStyle
[System.Windows.Automation.AutomationProperties]::SetName($toggleButton, $entryInfo.Content[0])
$toggleButton.Tag = @{ $toggleButton.Tag = @{
contentOn = if ($entryInfo.Content.Count -ge 1) { $entryInfo.Content[0] } else { "" } contentOn = if ($entryInfo.Content.Count -ge 1) { $entryInfo.Content[0] } else { "" }
@@ -232,6 +234,7 @@ function Invoke-WPFUIElements {
$comboBox.SetResourceReference([Windows.Controls.Control]::MarginProperty, "ButtonMargin") $comboBox.SetResourceReference([Windows.Controls.Control]::MarginProperty, "ButtonMargin")
$comboBox.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "ButtonFontSize") $comboBox.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "ButtonFontSize")
$comboBox.UseLayoutRounding = $true $comboBox.UseLayoutRounding = $true
[System.Windows.Automation.AutomationProperties]::SetName($comboBox, $entryInfo.Content)
foreach ($comboitem in ($entryInfo.ComboItems -split " ")) { foreach ($comboitem in ($entryInfo.ComboItems -split " ")) {
$comboBoxItem = New-Object Windows.Controls.ComboBoxItem $comboBoxItem = New-Object Windows.Controls.ComboBoxItem
@@ -273,6 +276,7 @@ function Invoke-WPFUIElements {
$baseWidth = [int]$entryInfo.ButtonWidth $baseWidth = [int]$entryInfo.ButtonWidth
$button.Width = [math]::Max($baseWidth, 350) $button.Width = [math]::Max($baseWidth, 350)
} }
[System.Windows.Automation.AutomationProperties]::SetName($button, $entryInfo.Content)
$itemsControl.Items.Add($button) | Out-Null $itemsControl.Items.Add($button) | Out-Null
$sync[$entryInfo.Name] = $button $sync[$entryInfo.Name] = $button
@@ -303,6 +307,7 @@ function Invoke-WPFUIElements {
$radioButton.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "ButtonFontSize") $radioButton.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "ButtonFontSize")
$radioButton.ToolTip = $entryInfo.Description $radioButton.ToolTip = $entryInfo.Description
$radioButton.UseLayoutRounding = $true $radioButton.UseLayoutRounding = $true
[System.Windows.Automation.AutomationProperties]::SetName($radioButton, $entryInfo.Content)
if ($entryInfo.Checked -eq $true) { if ($entryInfo.Checked -eq $true) {
$radioButton.IsChecked = $true $radioButton.IsChecked = $true
@@ -324,6 +329,7 @@ function Invoke-WPFUIElements {
$checkBox.ToolTip = $entryInfo.Description $checkBox.ToolTip = $entryInfo.Description
$checkBox.SetResourceReference([Windows.Controls.Control]::MarginProperty, "CheckBoxMargin") $checkBox.SetResourceReference([Windows.Controls.Control]::MarginProperty, "CheckBoxMargin")
$checkBox.UseLayoutRounding = $true $checkBox.UseLayoutRounding = $true
[System.Windows.Automation.AutomationProperties]::SetName($checkBox, $entryInfo.Content)
if ($entryInfo.Checked -eq $true) { if ($entryInfo.Checked -eq $true) {
$checkBox.IsChecked = $entryInfo.Checked $checkBox.IsChecked = $entryInfo.Checked
} }