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:
virtualtable
2026-08-19 16:54:24 -05:00
committed by GitHub
co-authored by WinUtil Contributor Chris Titus
parent b8b81edcdb
commit 4b2fe55a7a
4 changed files with 42 additions and 7 deletions
+4 -1
View File
@@ -33,7 +33,10 @@ Function Set-WinUtilService {
# Service exists, proceed with changing properties -- while handling auto delayed start for PWSH 5
if (($PSVersionTable.PSVersion.Major -lt 7) -and ($StartupType -eq "AutomaticDelayedStart")) {
sc.exe config $Name start=delayed-auto
sc.exe config $Name start= delayed-auto
if ($LASTEXITCODE -ne 0) {
throw "sc.exe config failed with exit code $LASTEXITCODE"
}
} else {
$service | Set-Service -StartupType $StartupType -ErrorAction Stop
}