mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
33 lines
795 B
PowerShell
33 lines
795 B
PowerShell
<#
|
|
.SYNOPSIS
|
|
Reads a private environment variable from Icinga for Windows
|
|
of the current PowerShell session
|
|
.DESCRIPTION
|
|
Reads a private environment variable from Icinga for Windows
|
|
of the current PowerShell session
|
|
.PARAMETER Name
|
|
The name of the variable to load the content from
|
|
.EXAMPLE
|
|
Get-IcingaPrivateEnvironmentVariable -Name 'AddTypeFunctions';
|
|
.NOTES
|
|
General notes
|
|
#>
|
|
function Get-IcingaPrivateEnvironmentVariable()
|
|
{
|
|
param (
|
|
[string]$Name
|
|
);
|
|
|
|
if ([string]::IsNullOrEmpty($Name)) {
|
|
return $null;
|
|
}
|
|
|
|
# Setup the environments in case not present already
|
|
New-IcingaEnvironmentVariable;
|
|
|
|
if ($global:Icinga.Private.ContainsKey($Name) -eq $FALSE) {
|
|
return $null;
|
|
}
|
|
|
|
return $global:Icinga.Private[$Name];
|
|
}
|