This commit is contained in:
2024-04-01 10:40:20 +02:00
parent 5152f44924
commit 8a7c4f3724
154 changed files with 100 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
# Restart Service Script
# Please enable external scripts and external scrips variable before use.
param (
[string[]]$serviceName
)
Foreach ($Service in $ServiceName)
{
Restart-Service $ServiceName -ErrorAction SilentlyContinue -ErrorVariable ServiceError
If (!$ServiceError) {
$Time=Get-Date
Write-Host "Restarted service $Service at $Time"
}
If ($ServiceError) {
write-host $error[0]
exit 3
}
}