Hi, I have myriad advanced functions, some of which heavily rely on the "main" advanced function which reads a .properties file and extracts some values by using regular expressions. I implemented the "main" advanced function to collect values from .properties file and return object with these values as properties.
Is there any way to call this main advanced function only once and store its output (custom object in my case) in global variable thus I could reference to needed value in other functions by variable.nameofproperty instead of calling function again and again from other functions.
i.e. $global:dfc = Get-DFCParameter -xCP1ComputerName VMContentServer
from some other function:
$Docbroker = $dfc.docbrokerhostname
$Docbase = $dfc.docbasename
$GlobalRegistryPassword = $dfc.globalregistrypassword