Adds a new section "Scripting" in the server UI where PowerShell modules can be defined. These can be used for defining a library of functions that can be used in any script. These modules are automatically synced to the launcher and imported upon script execution.
28 lines
706 B
C#
28 lines
706 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace LANCommander.Server.Models
|
|
{
|
|
public enum FunctionVisibility
|
|
{
|
|
Public,
|
|
Private
|
|
}
|
|
|
|
public class ModuleFunction
|
|
{
|
|
public Guid Id { get; set; } = Guid.NewGuid();
|
|
public string Name { get; set; }
|
|
public FunctionVisibility Visibility { get; set; } = FunctionVisibility.Public;
|
|
public string Content { get; set; }
|
|
}
|
|
|
|
public class Module
|
|
{
|
|
public string Name { get; set; }
|
|
public string Manifest { get; set; }
|
|
public List<ModuleFunction> Functions { get; set; } = new();
|
|
}
|
|
|
|
public record VerbGroup(string Name, IReadOnlyList<string> Verbs);
|
|
}
|