protected override void ProcessRecord() { bool result = false; switch (ParameterSetName) { case "ByAzureLogin": result = CTX.Login(TenantName, DestinationSite, PromptBehavior); break; default: result = CTX.Login(TenantName, DestinationSite, Credential); break; } if (!result) { throw new Exception("Something went trying to authenticate!"); } else if (PassThru) { } }