mirror of
https://github.com/MichaelGrafnetter/DSInternals
synced 2025-04-23 15:36:18 +00:00
42 lines
881 B
C#
42 lines
881 B
C#
namespace DSInternals.PowerShell.Commands
|
|
{
|
|
using System;
|
|
using System.Management.Automation;
|
|
using DSInternals.Common;
|
|
|
|
[Cmdlet(VerbsData.ConvertTo, "Hex")]
|
|
[OutputType(new Type[] { typeof(string) })]
|
|
public class ConvertToHexCommand : PSCmdlet
|
|
{
|
|
#region Parameters
|
|
|
|
[Parameter(
|
|
Mandatory = true,
|
|
Position = 0,
|
|
ValueFromPipeline = true
|
|
)]
|
|
public byte[] Input
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[Parameter]
|
|
public SwitchParameter UpperCase
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
#endregion Parameters
|
|
|
|
#region Cmdlet Overrides
|
|
|
|
protected override void ProcessRecord()
|
|
{
|
|
this.WriteObject(this.Input.ToHex(this.UpperCase.IsPresent));
|
|
}
|
|
|
|
#endregion Cmdlet Overrides
|
|
}
|
|
} |