mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 15:19:58 -05:00
11 lines
360 B
PowerShell
11 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;
|
|
}
|