private Dictionary<string, System.Management.Automation.PSObject> GetParameters(System.Collections.ObjectModel.Collection<FieldDescription> descriptions)
 {
     Dictionary<string, System.Management.Automation.PSObject> rtn = new Dictionary<string, System.Management.Automation.PSObject>();
     PSParamType parm = new PSParamType();
     foreach (FieldDescription descr in descriptions)
     {
         PSParameter prm = new PSParameter();
         prm.Name = descr.Name;
         if (descr.IsMandatory)
         {
             prm.Category = "Required";
         }
         else
         {
             prm.Category = "Optional";
         }
         prm.DefaultValue = descr.DefaultValue;
         prm.Description = descr.HelpMessage;
         prm.Type = Type.GetType(descr.ParameterAssemblyFullName);
         if (prm.Name.ToLower() == "file" || prm.Name.ToLower() == "filename")
         {
             prm.IsFileName = true;
         }
         if (prm.Name.ToLower() == "credential")
         {
             prm.IsCredential = true;
         }
         parm.Properties.Add(prm);
     }
     return rtn;
 }
示例#2
0
        private Dictionary <string, System.Management.Automation.PSObject> GetParameters(System.Collections.ObjectModel.Collection <FieldDescription> descriptions)
        {
            Dictionary <string, System.Management.Automation.PSObject> rtn = new Dictionary <string, System.Management.Automation.PSObject>();
            PSParamType parm = new PSParamType();

            foreach (FieldDescription descr in descriptions)
            {
                PSParameter prm = new PSParameter();
                prm.Name = descr.Name;
                if (descr.IsMandatory)
                {
                    prm.Category = "Required";
                }
                else
                {
                    prm.Category = "Optional";
                }
                prm.DefaultValue = descr.DefaultValue;
                prm.Description  = descr.HelpMessage;
                prm.Type         = Type.GetType(descr.ParameterAssemblyFullName);
                if (prm.Name.ToLower() == "file" || prm.Name.ToLower() == "filename")
                {
                    prm.IsFileName = true;
                }
                if (prm.Name.ToLower() == "credential")
                {
                    prm.IsCredential = true;
                }
                parm.Properties.Add(prm);
            }
            return(rtn);
        }
示例#3
0
 public PSParamDescriptor(PSParameter psparam) : base(psparam.Name, null)
 {
     this.psparam = psparam;
 }
示例#4
0
 public PSParamDescriptor(PSParameter psparam) : base(psparam.Name, null)
 {
     this.psparam = psparam;
 }