AddFunction

Adding a function.

Find the directory the functions are:
Get the directory by inputting following line.
[SALAD]
$SessionManager.GetValue("system.session.directory.scripts");

To see the folder with explorer directory, following line.
[SALAD]
explorer $SessionManager.GetValue("system.session.directory.scripts");

Make a function file:
for example: function named Echo-Info
Echo-Info.ps1

function global:Echo-Info()
#VISIBILITY:public
{
    $ret = [string]::Empty;
    $ret += $env:username;
    $ret += " on ";
    $ret += $env:computername;
    $ret;
}

(this file is linked from this page.Echo-Info.ps1)

Reflect the function:
Place the file in SALADROOT.scripts.
To reflect visibility of the functions, input follows.(Reflect-Visibility)
[SALAD]
Reflect-Visibility;

And the users can input Echo-Info in SALAD to get the name and the computer next session.
[SALAD]
Echo-Info;

Last edited Mar 2, 2013 at 12:59 PM by Tom__S, version 13

Comments

No comments yet.