/// <summary> /// Replicate an OS image to multiple target locations. This operation /// is only for publishers. You have to be registered as image /// publisher with Windows Azure to be able to call this. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineOSImageOperations. /// </param> /// <param name='imageName'> /// Required. The name of the virtual machine OS image to replicate. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the Replicate Virtual Machine /// Image operation. /// </param> /// <returns> /// The response body contains the published name of the image. /// </returns> public static VirtualMachineOSImageReplicateResponse Replicate(this IVirtualMachineOSImageOperations operations, string imageName, VirtualMachineOSImageReplicateParameters parameters) { return Task.Factory.StartNew((object s) => { return ((IVirtualMachineOSImageOperations)s).ReplicateAsync(imageName, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
/// <summary> /// Replicate an OS image to multiple target locations. This operation /// is only for publishers. You have to be registered as image /// publisher with Windows Azure to be able to call this. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineOSImageOperations. /// </param> /// <param name='imageName'> /// Required. The name of the virtual machine OS image to replicate. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the Replicate Virtual Machine /// Image operation. /// </param> /// <returns> /// The response body contains the published name of the image. /// </returns> public static Task<VirtualMachineOSImageReplicateResponse> ReplicateAsync(this IVirtualMachineOSImageOperations operations, string imageName, VirtualMachineOSImageReplicateParameters parameters) { return operations.ReplicateAsync(imageName, parameters, CancellationToken.None); }
protected PSArgument[] CreateVirtualMachineOSImageReplicateParameters() { string imageName = string.Empty; VirtualMachineOSImageReplicateParameters parameters = new VirtualMachineOSImageReplicateParameters(); return ConvertFromObjectsToArguments(new string[] { "ImageName", "Parameters" }, new object[] { imageName, parameters }); }