mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-14 06:35:51 -06:00
fix stuck service tweaks
This commit is contained in:
parent
d586219192
commit
bd43288f99
@ -569,10 +569,13 @@
|
||||
Write-Logs -Level INFO -Message "Starting Services Modification" -LogPath $sync.logfile
|
||||
|
||||
$ServicesToModify | ForEach-Object {
|
||||
$service = Get-Service -Name W32Time -ErrorAction SilentlyContinue
|
||||
if ($service.Length -gt 0) {
|
||||
Stop-Service "$($psitem.name)"
|
||||
Set-Service "$($psitem.name)" -StartupType $($psitem.StartupType)
|
||||
Write-Logs -Level INFO -Message "Service $($psitem.name) set to $($psitem.StartupType)" -LogPath $sync.logfile
|
||||
}
|
||||
}
|
||||
|
||||
Write-Logs -Level INFO -Message "Finished setting Services" -LogPath $sync.logfile
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user