Files
winutil/Compile.ps1
T
GabiNun2 e8c1401cce feat: add config-driven AppX package removal tab
- Add config/appx.json with curated list of removable AppX packages

- Add AppX Removal tab (WPFTab6) with Select All, Clear, and Remove buttons

- Reuse existing Invoke-WPFUIElements engine for minimal code footprint

- Add Invoke-WPFAppxRemoval.ps1 for background runspace package removal

- Add theme colors for the new tab button in light and dark modes
2026-06-21 17:57:41 +03:00

56 lines
1.5 KiB
PowerShell

param (
[switch]$Run
)
$OFS = "`r`n"
# Variable to sync between runspaces
$sync = [Hashtable]::Synchronized(@{})
$sync.configs = @{}
$script = (Get-Content -Path scripts\start.ps1) -replace '#{replaceme}', (Get-Date -Format 'yy.MM.dd')
$script += Get-ChildItem -Path functions -Recurse -File | Get-Content -Raw
Get-ChildItem config | ForEach-Object {
$obj = Get-Content -Path $_.FullName -Raw | ConvertFrom-Json
if ($_.Name -eq "applications.json") {
$fixed = [ordered]@{}
foreach ($p in $obj.PSObject.Properties) {
$fixed["WPFInstall$($p.Name)"] = $p.Value
}
$obj = [pscustomobject]$fixed
}
if ($_.Name -eq "appx.json") {
$fixed = [ordered]@{}
foreach ($p in $obj.PSObject.Properties) {
$keyName = "WPFAppx$($p.Name -replace '\.', '_')"
$val = $p.Value
$val | Add-Member -MemberType NoteProperty -Name "PackageId" -Value $p.Name -Force
$fixed[$keyName] = $val
}
$obj = [pscustomobject]$fixed
}
$json = $obj | ConvertTo-Json -Depth 10
$sync.configs[$_.BaseName] = $obj
$script += "`$sync.configs.$($_.BaseName) = @'`r`n$json`r`n'@ | ConvertFrom-Json"
}
$xaml = Get-Content -Path xaml\inputXML.xaml -Raw
$script += "`$inputXML = @'`r`n$xaml`r`n'@"
$autounattendXml = Get-Content -Path tools\autounattend.xml -Raw
$script += "`$WinUtilAutounattendXml = @'`r`n$autounattendXml`r`n'@"
$script += Get-Content -Path scripts\main.ps1 -Raw
Set-Content -Path winutil.ps1 -Value $script
if ($Run) {
.\Winutil.ps1
}