Hi, I wrote more than 20 advanced functions to automate installation/configuration process of document management platform (OpenText Documentum xCP). One of them is "input" function for many others since it returns an object containing 3 crucial properties (docbroker host name, docbase name and global registry password). Can I call this "main" function only once, store returned object into global variable and then just use property of that variable in other functions?
i.e. $global:dfc = Get-DFCParameter -xCP1ComputerName VMContentServer
from some other function:
$Docbroker = $dfc.docbrokerhostname
$Docbase = $dfc.docbasename
$GlobalRegistryPassword = $dfc.globalregistrypassword
Note: I posted similar question last year but no one answered. More luck this time I hope.
### Use the variable syntax to create a new environment variable
$env:FirstName = 'Trevor'
### Use the built-in env: PSDrive
New-Item -Path env:\LastName -Value Sullivan
### Set an environment variable using the System.Environment .NET class
The topic ‘Global variable in PowerShell module’ is closed to new replies.