예제 #1
0
        public static IEnumerable <ShellVerb> GetShellVerbs()
        {
            foreach (string keyName in CommandStoreShell.GetSubKeyNames())
            {
                RegistryKey key = CommandStoreShell.OpenSubKey(keyName);

                ShellVerb verb = ShellVerb.From(key);

                yield return(verb);
            }
        }
예제 #2
0
        public static ShellVerb GetShellVerb(string name)
        {
            ShellVerb verb = null;

            foreach (ShellVerb shellVerb in GetShellVerbs())
            {
                if (shellVerb.Name == name)
                {
                    verb = shellVerb;
                }
            }

            return(verb);
        }
예제 #3
0
        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);
            }
        }