Operating system: Windows 10 20H2 x64
PowerShell version(s): v7.1.2, v5.1
Not sure if this is the right place to post this as more than reporting an issue this is more of a question.
As per subject I'm working on a project requiring me to dotsource an external .ps1 containing variables for the workflow, I'm not a big fan of this for a number of reasons and was wondering if there is a way to make intellisense aware of the variables defined in the external file.
What I am doing is just a standard import at runtime:
Code: Select all
$configFile = '{0}\{1}' -f (Split-Path $script:MyInvocation.MyCommand.Path), 'Config.ps1'
try
{
# Import configuration file
. $configFile
}
Thanks in advance for any feedback on this!