public PowerShellLauncherMenuItem(CovenantAPI CovenantClient, EventPrinter EventPrinter) : base(CovenantClient, EventPrinter) { this.powerShellLauncher = CovenantClient.ApiLaunchersPowershellGet(); this.MenuTitle = powerShellLauncher.Name; this.MenuDescription = powerShellLauncher.Description; this.AdditionalOptions.Add(new MenuCommandPowerShellLauncherShow(CovenantClient)); this.AdditionalOptions.Add(new MenuCommandPowerShellLauncherGenerate(CovenantClient)); this.AdditionalOptions.Add(new MenuCommandPowerShellLauncherCode()); this.AdditionalOptions.Add(new MenuCommandPowerShellLauncherHost(CovenantClient)); this.AdditionalOptions.Add(new MenuCommandPowerShellLauncherWriteFile()); var setCommand = new MenuCommandPowerShellLauncherSet(CovenantClient); this.AdditionalOptions.Add(setCommand); this.AdditionalOptions.Add(new MenuCommandGenericUnset(setCommand.Parameters.FirstOrDefault(P => P.Name == "Option").Values)); this.Refresh(); }
public PowerShellLauncherMenuItem(CovenantAPI CovenantClient) : base(CovenantClient) { try { this.PowerShellLauncher = CovenantClient.ApiLaunchersPowershellGet(); this.MenuTitle = PowerShellLauncher.Name; this.MenuDescription = PowerShellLauncher.Description; this.AdditionalOptions.Add(new MenuCommandPowerShellLauncherShow(CovenantClient)); this.AdditionalOptions.Add(new MenuCommandPowerShellLauncherGenerate(CovenantClient)); this.AdditionalOptions.Add(new MenuCommandPowerShellLauncherCode(CovenantClient)); this.AdditionalOptions.Add(new MenuCommandPowerShellLauncherHost(CovenantClient)); this.AdditionalOptions.Add(new MenuCommandPowerShellLauncherWriteFile(CovenantClient)); var setCommand = new MenuCommandPowerShellLauncherSet(CovenantClient); this.AdditionalOptions.Add(setCommand); this.AdditionalOptions.Add(new MenuCommandGenericUnset(setCommand.Parameters.FirstOrDefault(P => P.Name == "Option").Values)); } catch (HttpOperationException e) { EliteConsole.PrintFormattedWarningLine("CovenantException: " + e.Response.Content); } }