I would like to include script files with such pseudo syntax:
Include '.\scripA.ps1'
But the only thing I have found is some thing like this:
$thisScript = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
. ($thisScript + '.\scriptA.ps1')
that is ugly.
Is there some nice way to include scripts with relative paths?
You can utilize the $PSScriptRoot parameter like this:
. "$PSScriptRoot\script.ps1"