PowerShellFar

Here you can discuss about your favorite plug-in.
Locked
S1nF0ny
Posts: 2
Joined: Thu Jul 19, 2007 4:50 pm

PowerShellFar

Post by S1nF0ny »

I am having an issue with PowerShellFar. I cannot find how to call and execute custom functions and aliases.

I have $Psf.Settings.PluginStartupCode set to "Profile-.ps1" which does indeed run on startup. From here, how can I call any functions in Profile-.ps1? None of my functions are recognized from the command line or the editor.

Far 1.71.2126
Far.Net3 3.3.19
PowerShellFar 1.1.19
nightroman
Posts: 15
Joined: Wed Mar 14, 2007 3:23 am

Post by nightroman »

My first idea is that you have to set PluginStartupCode to ". Profile-.ps1" (mind dot-space-profile), not "Profile-.ps1". If you don't use dot your profile is executed in its own script scope and all stuff simply goes out of the global scope. If you use dot the script is executed in the global scope and all aliases and functions remain defined in the global scope which is exactly what we need from a profile.

So, first of all check that your startup code is like ". Profile-.ps1"
S1nF0ny
Posts: 2
Joined: Thu Jul 19, 2007 4:50 pm

Post by S1nF0ny »

Thank you so much, that worked perfectly!
Locked