mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2026-10-08 11:39:10 +11:00
fix(system): correct service, update repair, and legacy imports (#4966)
* fix(system): correct sc.exe argument syntax, reg deletion, and ipv6 dns guard * fix(impex): exclude legacy Install metadata from flattened import * fix(service): throw on non-zero LASTEXITCODE from sc.exe config * refactor(dns): revert unnecessary ipv6 guard per review feedback * test(impex): cover legacy config imports --------- Co-authored-by: WinUtil Contributor <contributor@winutil.local> Co-authored-by: Chris Titus <contact@christitus.com>
This commit is contained in:
co-authored by
WinUtil Contributor
Chris Titus
parent
b8b81edcdb
commit
4b2fe55a7a
@@ -271,6 +271,30 @@ Describe "Invoke-WPFImpex import selection state" {
|
||||
Should -Invoke -CommandName Write-Error -Times 0 -Exactly
|
||||
}
|
||||
|
||||
It "imports legacy selection groups without treating Install metadata as a selection" {
|
||||
$legacyConfigPath = Join-Path $TestDrive "legacy-config.json"
|
||||
[ordered]@{
|
||||
Install = @(
|
||||
[pscustomobject]@{
|
||||
winget = "Git.Git"
|
||||
choco = "git"
|
||||
}
|
||||
)
|
||||
WPFInstall = @("WPFInstallGit")
|
||||
WPFTweaks = @("WPFTweaksTelemetry")
|
||||
WPFToggle = @("WPFToggleDarkMode")
|
||||
WPFFeature = @("WPFFeatureSandbox")
|
||||
} | ConvertTo-Json -Depth 4 | Set-Content -LiteralPath $legacyConfigPath
|
||||
|
||||
Invoke-WPFImpex -type "import" -Config $legacyConfigPath
|
||||
|
||||
@($script:sync.selectedApps) | Should -Be @("WPFInstallGit")
|
||||
@($script:sync.selectedTweaks) | Should -Be @("WPFTweaksTelemetry")
|
||||
@($script:sync.selectedToggles) | Should -Be @("WPFToggleDarkMode")
|
||||
@($script:sync.selectedFeatures) | Should -Be @("WPFFeatureSandbox")
|
||||
Should -Invoke -CommandName Write-Error -Times 0 -Exactly
|
||||
}
|
||||
|
||||
It "preserves selections and does not reset the UI after an invalid import" {
|
||||
$script:sync.selectedApps.Add("WPFInstallExisting")
|
||||
$script:sync.selectedTweaks.Add("WPFTweaksExisting")
|
||||
|
||||
Reference in New Issue
Block a user