/// <summary>
        /// Executes the operations associated with the cmdlet.
        /// </summary>
        public override void ExecuteCmdlet()
        {
            IAgreementDocument operation = Partner.AgreementTemplates.ById(TemplateId).Document;

            if (!string.IsNullOrEmpty(Country))
            {
                operation = operation.ByCountry(Country);
            }

            if (!string.IsNullOrEmpty(Language))
            {
                operation = operation.ByLanguage(Language);
            }

            WriteObject(new PSAgreementDocument(operation.GetAsync().ConfigureAwait(false).GetAwaiter().GetResult()));
        }
Beispiel #2
0
        /// <summary>
        /// Executes the operations associated with the cmdlet.
        /// </summary>
        public override void ExecuteCmdlet()
        {
            Scheduler.RunTask(async() =>
            {
                IPartner partner             = await PartnerSession.Instance.ClientFactory.CreatePartnerOperationsAsync(CorrelationId, CancellationToken).ConfigureAwait(false);
                IAgreementDocument operation = partner.AgreementTemplates.ById(TemplateId).Document;

                if (!string.IsNullOrEmpty(Country))
                {
                    operation = operation.ByCountry(Country);
                }

                if (!string.IsNullOrEmpty(Language))
                {
                    operation = operation.ByLanguage(Language);
                }

                WriteObject(new PSAgreementDocument(await operation.GetAsync(CancellationToken).ConfigureAwait(false)));
            }, true);
        }