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
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user