public static IEnumerable <ShellVerb> GetShellVerbs() { foreach (string keyName in CommandStoreShell.GetSubKeyNames()) { RegistryKey key = CommandStoreShell.OpenSubKey(keyName); ShellVerb verb = ShellVerb.From(key); yield return(verb); } }
public static ShellVerb GetShellVerb(string name) { ShellVerb verb = null; foreach (ShellVerb shellVerb in GetShellVerbs()) { if (shellVerb.Name == name) { verb = shellVerb; } } return(verb); }
protected override void ProcessRecord() { if (ParameterSetName == "ByName") { string value = DynamicParameters["Name"].Value.ToString(); ShellVerb verb = RegistryHelper.GetShellVerb(value); if (Properties) { WriteObject(verb.Properties); } else { WriteObject(verb); } } else { WriteObject(RegistryHelper.GetShellVerbs(), true); } }