I want call execution for a myScript1.ps1 script inside a second myScript2.ps1 script inside Powershell ISE.
The following code inside MyScript2.ps1, works fine from
I had a problem with this. I didn't use any clever $MyInvocation
stuff to fix it though. If you open the ISE by right clicking a script file and selecting edit
then open the second script from within the ISE you can invoke one from the other by just using the normal .\script.ps1 syntax.
My guess is that the ISE has the notion of a current folder and opening it like this sets the current folder to the folder containing the scripts.
When I invoke one script from another in normal use I just use .\script.ps1, IMO it's wrong to modify the script just to make it work in the ISE properly...