Skip to content

A .NET library to interface with different interpreters and shells

Notifications You must be signed in to change notification settings

Zaph-x/SkriptKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SkriptKit

A tool for storing and running scripts in .NET

Purpose

The purpose of the SkriptKit library is as follows: To make it easier to run scripts from a given interpreter or shell programmatically.

The library will be used in future .NET projects where an interface between the application and a given shell or script interpreter is needed.

Storing Scripts

Using SkriptKit, script objects can be stored in JSON format for dynamic loading of scripts. Furthermore, scripts can contain placeholder values that can be used in applications where the user might want to enter custom values.

Example Code

Reading A Script From A File

string content;
using (StreamReader sr = new StreamReader(@".\getADUserEmail.ps1"))
{
    content = sr.ReadToEnd();
    /*

    $sams = Import-Csv .\sams.csv

    foreach ($entry in $sams) {
        $(Get-ADUser $entry.sAMAccountName -Properties Initials | select -ExpandProperty initials) | out-host
    }
    
    */
}
Script script = new Script("pwsh", content, false);
script.Run();
Console.WriteLine(script.Shell.StandardOutput);
/*

JAMS
KUTF
OGHS
LKRT
MOEEs

*/

About

A .NET library to interface with different interpreters and shells

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages