public override async Task <IISWebOptions> Aquire(Target target, IInputService inputService, RunLevel runLevel) { var args = _arguments.GetArguments <IISWebArguments>(); var ret = new IISWebOptions(args); var ask = true; if (target.IIS) { if (runLevel.HasFlag(RunLevel.Advanced)) { ask = await inputService.PromptYesNo("Use different site for installation?", false); } else { ask = false; } } if (ask) { var chosen = await inputService.ChooseRequired("Choose site to create new bindings", _iisClient.WebSites, x => Choice.Create(x.Id, x.Name, x.Id.ToString())); ret.SiteId = chosen; } return(ret); }
public override async Task <IISFtpOptions> Aquire(Target renewal, IInputService inputService, RunLevel runLevel) { var ret = new IISFtpOptions(); var chosen = await inputService.ChooseRequired("Choose ftp site to bind the certificate to", _iisClient.FtpSites, x => Choice.Create(x.Id, x.Name, x.Id.ToString())); ret.SiteId = chosen; return(ret); }
async Task InputCommonName(IInputService input, List<IISHelper.IISBindingOption> filtered, IISOptions options) { var sorted = SortBindings(filtered).ToList(); var common = await input.ChooseRequired( "Please pick the main host, which will be presented as the subject of the certificate", sorted, (x) => Choice.Create(x, description: x.HostUnicode, @default: sorted.IndexOf(x) == 0)); ParseCommonName(common.HostUnicode, filtered.Select(x => x.HostUnicode), options); }