protected override void ProcessRecord()
        {
            base.ProcessRecord();

            ExecuteClientAction(() =>
            {
                var parameters = new VirtualMachineImageListOffersParameters
                {
                    Location = Location.Canonicalize(),
                    PublisherName = PublisherName
                };

                VirtualMachineImageResourceList result = this.VirtualMachineImageClient.ListOffers(parameters);

                var images = from r in result.Resources
                             select new PSVirtualMachineImageOffer
                             {
                                 RequestId = result.RequestId,
                                 StatusCode = result.StatusCode,
                                 Id = r.Id,
                                 Location = r.Location,
                                 Offer = r.Name,
                                 PublisherName = this.PublisherName
                             };

                WriteObject(images, true);
            });
        }
 /// <summary>
 /// Gets a list of virtual machine image offers.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Compute.IVirtualMachineImageOperations.
 /// </param>
 /// <param name='parameters'>
 /// Optional.
 /// </param>
 /// <returns>
 /// A list of virtual machine image resource information.
 /// </returns>
 public static Task<VirtualMachineImageResourceList> ListOffersAsync(this IVirtualMachineImageOperations operations, VirtualMachineImageListOffersParameters parameters)
 {
     return operations.ListOffersAsync(parameters, CancellationToken.None);
 }
 /// <summary>
 /// Gets a list of virtual machine image offers.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Compute.IVirtualMachineImageOperations.
 /// </param>
 /// <param name='parameters'>
 /// Optional.
 /// </param>
 /// <returns>
 /// A list of virtual machine image resource information.
 /// </returns>
 public static VirtualMachineImageResourceList ListOffers(this IVirtualMachineImageOperations operations, VirtualMachineImageListOffersParameters parameters)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((IVirtualMachineImageOperations)s).ListOffersAsync(parameters);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }