Call a function in another script when executing using ‘Run With PowerShell’

In the worker file change to this:

. "c:\scratch\b.ps1"

ShowMessage "Hello"

As @RoiDanton mentioned below:

Attention when using relative pathing: Don’t forget to prepend a dot
before the path . “.\b.ps1”.

The first dot is an operator used to modify the scope and in that context it has nothing to do with paths. See Dot Source Notation.

Leave a Comment