/// <summary> /// Executes the operations associated with the cmdlet. /// </summary> public override void ExecuteCmdlet() { ResourceCollection <License> licenses = Partner.Customers[CustomerId] .Users[UserId].Licenses.GetAsync(LicenseGroup?.Select(item => item).ToList()).GetAwaiter().GetResult(); WriteObject(licenses.Items.Select(l => new PSLicense(l)), true); }
/// <summary> /// Executes the operations associated with the cmdlet. /// </summary> public override void ExecuteCmdlet() { ResourceCollection <License> licenses; try { licenses = Partner.Customers[CustomerId].Users[UserId].Licenses.Get(LicenseGroup?.Select(item => item).ToList()); WriteObject(licenses.Items.Select(l => new PSLicense(l)), true); } finally { licenses = null; } }
/// <summary> /// Executes the operations associated with the cmdlet. /// </summary> public override void ExecuteCmdlet() { Scheduler.RunTask(async() => { IPartner partner = await PartnerSession.Instance.ClientFactory.CreatePartnerOperationsAsync(); ResourceCollection <License> licenses = await partner.Customers[CustomerId] .Users[UserId].Licenses.GetAsync(LicenseGroup?.Select(item => item).ToList()); WriteObject(licenses.Items.Select(l => new PSLicense(l)), true); }, true); }