protected override void ProcessRecord() { base.ProcessRecord(); try { client?.Dispose(); int timeout = GetPreferredTimeout(); WriteDebug($"Cmdlet Timeout : {timeout} milliseconds."); client = new InvoiceServiceClient(AuthProvider, new Oci.Common.ClientConfiguration { RetryConfiguration = retryConfig, TimeoutMillis = timeout, ClientUserAgent = PSUserAgent }); string region = GetPreferredRegion(); if (region != null) { WriteDebug("Choosing Region:" + region); client.SetRegion(region); } if (Endpoint != null) { WriteDebug("Choosing Endpoint:" + Endpoint); client.SetEndpoint(Endpoint); } } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }