mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
23 lines
572 B
PowerShell
23 lines
572 B
PowerShell
function Get-IcingaComponentLock()
|
|
{
|
|
param (
|
|
[string]$Name = $null
|
|
);
|
|
|
|
if ([string]::IsNullOrEmpty($Name)) {
|
|
Write-IcingaConsoleError 'You have to specify the component to get the lock version';
|
|
return;
|
|
}
|
|
|
|
$LockedComponents = Get-IcingaPowerShellConfig -Path 'Framework.Repository.ComponentLock';
|
|
|
|
if ($null -eq $LockedComponents) {
|
|
return $null;
|
|
}
|
|
|
|
if (Test-IcingaPowerShellConfigItem -ConfigObject $LockedComponents -ConfigKey $Name) {
|
|
return $LockedComponents.$Name;
|
|
}
|
|
|
|
return $null;
|
|
}
|