I have the following script in directory c:\scripts\
.
# . c:\scripts\anotherScript.ps1
function GetScriptRoot { Split-Path $script:MyInvocation.MyCommand.Path }
. "$(GetScriptroot)\anotherScript.ps1"
However, it raises an error in ISE. Is it a way which works in both console and ISE? I am trying not to use the full absolute path.