Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Management.Automation;
- using System.Collections;
- using System.IO;
- using System.Runtime.InteropServices;
- namespace WindowsPowerShell2
- {
- [Cmdlet(VerbsCommon.Remove, "Profile", SupportsShouldProcess = true)]
- public class DeleteProfiler : PSCmdlet
- {
- [DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Ansi,
- EntryPoint = "DeleteProfileA")]
- public static unsafe extern bool DeleteProfile(string Palabra);
- #region Parameters
- [Parameter( Mandatory = true)]
- [ValidateNotNullOrEmpty]
- public string SecurityID
- {
- get { return sid; }
- set { sid = value; }
- }
- private string sid;
- #endregion
- protected unsafe override void ProcessRecord()
- {
- base.ProcessRecord();
- try
- {
- DeleteProfile(sid);
- }
- catch (Exception)
- {
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement