LANCommander/LANCommander.SamplePlugin/SampleCmdlet.cs
2026-07-28 19:06:33 -05:00

20 lines
613 B
C#

using System.Management.Automation;
namespace LANCommander.SamplePlugin;
/// <summary>
/// A cmdlet added by the sample plugin. Once registered via
/// <see cref="SamplePowerShellExtension"/> it is callable from any LANCommander script as
/// <c>Get-SampleGreeting -Name "World"</c>.
/// </summary>
[Cmdlet(VerbsCommon.Get, "SampleGreeting")]
public sealed class SampleGreetingCmdlet : PSCmdlet
{
[Parameter(Position = 0)]
public string Name { get; set; } = "World";
protected override void ProcessRecord()
{
WriteObject($"Hello, {Name}, from the LANCommander sample plugin!");
}
}