mirror of
https://github.com/MichaelGrafnetter/DSInternals
synced 2025-04-23 15:36:18 +00:00
44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
namespace DSInternals.PowerShell.Commands
|
|
{
|
|
using DSInternals.Common.Data;
|
|
using System.Management.Automation;
|
|
|
|
[Cmdlet(VerbsData.Save, "DPAPIBlob")]
|
|
// TODO: Export None as resource.
|
|
[OutputType("None")]
|
|
public class SaveDPAPIBlobCmdlet : PSCmdletEx
|
|
{
|
|
[Parameter(
|
|
Mandatory = true,
|
|
ValueFromPipeline = true
|
|
)]
|
|
[ValidateNotNullOrEmpty]
|
|
[Alias("DPAPIBlob", "Object", "Blob", "BackupKey")]
|
|
public DPAPIObject DPAPIObject
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[Parameter(
|
|
Mandatory = true,
|
|
Position = 0
|
|
)]
|
|
[ValidateNotNullOrEmpty]
|
|
[Alias("Path")]
|
|
public string DirectoryPath
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
protected override void ProcessRecord()
|
|
{
|
|
string resolvedPath = this.ResolveSinglePath(this.DirectoryPath);
|
|
// TODO: Exception handling
|
|
// TODO: Verbose
|
|
// TODO: WhatIf
|
|
this.DPAPIObject.SaveTo(resolvedPath);
|
|
}
|
|
}
|
|
}
|