mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
12 lines
360 B
PowerShell
12 lines
360 B
PowerShell
|
|
function Get-IcingaForWindowsServicePid()
|
||
|
|
{
|
||
|
|
[string]$PidFile = (Join-Path -Path (Get-IcingaCacheDir) -ChildPath 'service.pid');
|
||
|
|
[string]$IfWPid = Read-IcingaFileSecure -File $PidFile;
|
||
|
|
|
||
|
|
if ([string]::IsNullOrEmpty($IfWPid) -eq $FALSE) {
|
||
|
|
$IfWPid = $IfWPid.Replace("`r`n", '').Replace("`n", '').Replace(' ', '');
|
||
|
|
}
|
||
|
|
|
||
|
|
return $IfWPid;
|
||
|
|
}
|