mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Add smart service interaction functions
This commit is contained in:
parent
ba1dc01c58
commit
071a26cc62
3 changed files with 30 additions and 0 deletions
10
lib/core/framework/Restart-IcingaService.psm1
Normal file
10
lib/core/framework/Restart-IcingaService.psm1
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
function Restart-IcingaService()
|
||||||
|
{
|
||||||
|
param(
|
||||||
|
$Service
|
||||||
|
);
|
||||||
|
|
||||||
|
if (Get-Service $Service -ErrorAction SilentlyContinue) {
|
||||||
|
Restart-Service $Service;
|
||||||
|
}
|
||||||
|
}
|
||||||
10
lib/core/framework/Start-IcingaService.psm1
Normal file
10
lib/core/framework/Start-IcingaService.psm1
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
function Start-IcingaService()
|
||||||
|
{
|
||||||
|
param(
|
||||||
|
$Service
|
||||||
|
);
|
||||||
|
|
||||||
|
if (Get-Service $Service -ErrorAction SilentlyContinue) {
|
||||||
|
Start-Service $Service;
|
||||||
|
}
|
||||||
|
}
|
||||||
10
lib/core/framework/Stop-IcingaService.psm1
Normal file
10
lib/core/framework/Stop-IcingaService.psm1
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
function Stop-IcingaService()
|
||||||
|
{
|
||||||
|
param(
|
||||||
|
$Service
|
||||||
|
);
|
||||||
|
|
||||||
|
if (Get-Service $Service -ErrorAction SilentlyContinue) {
|
||||||
|
Stop-Service $Service;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue