#region Copyright /* * Copyright © 2017 NetApp, Inc. All Rights Reserved. * * CONFIDENTIALITY NOTICE: THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION OF * NETAPP, INC. USE, DISCLOSURE OR REPRODUCTION IS PROHIBITED WITHOUT THE PRIOR * EXPRESS WRITTEN PERMISSION OF NETAPP, INC. */ #endregion #region Using Directives using System.Linq; using System.Management.Automation; using SolidFire.Core; using SolidFire.Element.Api; #endregion namespace SolidFire.Account.Set { [Cmdlet(VerbsCommon.Set, "SFLoginBanner", SupportsShouldProcess = true, DefaultParameterSetName = "enable", ConfirmImpact = ConfirmImpact.Medium)] public class SetSFLoginBanner : SFCmdlet { #region Private Data #endregion #region Parameters [Parameter(Position = 0, HelpMessage = "The HTML string to use for the Login Banner.")] public string Banner { get; set; } [Parameter(ParameterSetName = "enable", HelpMessage = "Include this parameter to enable the custom Login Banner")] public SwitchParameter Enabled { get; set; } [Parameter(ParameterSetName = "disable", HelpMessage = "Include this parameter to disable the custom Login Banner")] public SwitchParameter Disabled { get; set; } #endregion #region Cmdlet Overrides protected override void BeginProcessing() { base.BeginProcessing(); CheckConnection(); } protected override void ProcessRecord() { base.ProcessRecord(); // Assemble the parameter object var request = new SetLoginBannerRequest { Banner = Banner, Enabled = !Disabled.IsPresent || Enabled.IsPresent || (!Enabled.IsPresent && !Disabled.IsPresent) }; var results = SendRequest(method: "SetLoginBanner", request: request); WriteObject(results.Select(r => r.Result)); } #endregion } }