I have a header.ps1 file that need to be called from the Main.ps1 script. They are both under the same directory.
In the header.ps1 file, it started off with following...
[CmdletBinding()]
param(
[String]$PROJECTNAME = 'PSToolBox',
[string]$SCRIPTNAME = 'accountSelector.ps1'
)
In the Main.ps1 file, the following does work except I cannot use header.ps1 parameters.
This works:
. ($PSScriptRoot + '\header.ps1')
This does NOT work:
. (($PSScriptRoot + '\header.ps1') -PROJECTNAME 'LunchBox' -SCRIPTNAME 'MyLunch.ps1')
So, how to dot the relative path with passing the parameters in powershell script?