protected override void ProcessRecord() { using (var clientContext = CreateClientContext()) { var context = new HarshProvisionerContext(clientContext); try { var provisioner = new HarshProvisioner(); AddChildren(provisioner, Children); provisioner.ProvisionAsync(context).Wait(); } catch (AggregateException ex) { foreach (var iex in ex.InnerExceptions) { WriteError(new ErrorRecord(iex, null, ErrorCategory.OperationStopped, null)); } } catch (Exception ex) { WriteError(new ErrorRecord(ex, null, ErrorCategory.OperationStopped, null)); } } }
protected override void ProcessRecord() { using (var clientContext = CreateClientContext()) { var context = new HarshProvisionerContext(clientContext); try { var provisioner = new HarshProvisioner(); AddChildren(provisioner, Children); provisioner.ProvisionAsync(context).Wait(); } catch (AggregateException ex) { foreach (var iex in ex.InnerExceptions) { WriteError(new ErrorRecord(iex, null, ErrorCategory.OperationStopped, null)); } } catch (Exception ex) { WriteError(new ErrorRecord(ex, null, ErrorCategory.OperationStopped, null)); } } }
protected override async Task InitializeAsync() { await base.InitializeAsync(); if (Web == null) { throw Logger.Fatal.InvalidOperation(SR.HarshServerProvisionerConverter_OnlyWebAndSiteSupported); } ClientContext = new ClientContext(Web.Url); ProvisionerContext = new HarshProvisionerContext(ClientContext); }
protected override async Task InitializeAsync() { await base.InitializeAsync(); if (Web == null) { throw Logger.Fatal.InvalidOperation(SR.HarshServerProvisionerConverter_OnlyWebAndSiteSupported); } ClientContext = new ClientContext(Web.Url); ProvisionerContext = new HarshProvisionerContext(ClientContext); }
public SharePointClientTest(ITestOutputHelper output) : base(output) { Fixture = new SharePointClientFixture(); ManualResolver = new ClientObjectManualResolver(CreateResolveContext); var listSink = new HarshProvisionerOutputSinkList(); Output = listSink.Output; Context = new HarshProvisionerContext(ClientContext) .WithOutputSink( new HarshProvisionerOutputSinkComposite( new HarshProvisionerOutputSinkSerilog(HarshLog.ForContext("ProvisionerOutput", true)), listSink ) ); }