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; }
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); }
public PSParamDescriptor(PSParameter psparam) : base(psparam.Name, null) { this.psparam = psparam; }