2024-08-21 20:19:04 -05:00
|
|
|
|
using PeanutButter.INI;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.Management.Automation;
|
2025-09-22 00:29:51 -05:00
|
|
|
|
using LANCommander.SDK.Services;
|
2024-08-21 20:19:04 -05:00
|
|
|
|
|
|
|
|
|
|
namespace LANCommander.SDK.PowerShell.Cmdlets
|
|
|
|
|
|
{
|
|
|
|
|
|
[Cmdlet(VerbsCommon.Get, "UserCustomField")]
|
|
|
|
|
|
[OutputType(typeof(string))]
|
2026-01-24 16:37:07 -06:00
|
|
|
|
public class GetUserCustomFieldCmdlet(ProfileClient profileClient) : Cmdlet
|
2024-08-21 20:19:04 -05:00
|
|
|
|
{
|
2026-05-08 02:02:33 -05:00
|
|
|
|
[Parameter(Mandatory = true, Position = 0, HelpMessage = "The name of the custom field to retrieve for the current user.")]
|
2024-08-21 20:19:04 -05:00
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
protected override void ProcessRecord()
|
|
|
|
|
|
{
|
2025-09-24 20:58:23 -05:00
|
|
|
|
var result = profileClient.GetCustomFieldAsync(Name).GetAwaiter().GetResult();
|
2024-08-21 20:19:04 -05:00
|
|
|
|
|
|
|
|
|
|
WriteObject(result);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|