more fixes to control-service
This commit is contained in:
@@ -318,7 +318,7 @@ Function Control-Service
|
||||
$StopCmd = $ArgString -replace ' -Restart ', ' -Stop '
|
||||
$StartCmd = $ArgString -replace ' -Restart ', ' -Start '
|
||||
Invoke-Expression $StopCmd
|
||||
Start-Sleep -Seconds 10
|
||||
#Start-Sleep -Seconds 10
|
||||
Invoke-Expression $StartCmd
|
||||
Exit
|
||||
}
|
||||
@@ -350,11 +350,11 @@ Function Control-Service
|
||||
LogMsg " ${verbing} ${displayname}"
|
||||
Switch ( $verb) {
|
||||
'start' {
|
||||
Try { Start-Service -Name $svc }
|
||||
Try { Start-Service -Name $name }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
}
|
||||
'stop' {
|
||||
Try { Stop-Service -Name $svc -Force }
|
||||
Try { Stop-Service -Name $name -Force }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user