/// <summary> /// Download files using PowerShell's Invoke-WebRequest. If not destination is specified in options, Windows temp folder will be used. /// </summary> /// <param name="install"></param> /// <param name="url">The url for the file to download</param> /// <param name="options">Additional download options</param> /// <returns></returns> public static IOfferRemoteInstallation Download(this IOfferRemoteInstallation install, string url, Action<IOfferDownloadOptions> options = null) { var downloadOptions = new DownloadOptions(); if (options != null) { options(downloadOptions); } var downloadOperation = new DownloadOperation(url, downloadOptions.Values); Configure.Operation(install, downloadOperation); return install; }
public DownloadOperation(string url, DownloadOptions.DownloadOptionsValues values) { _url = url; _values = values; }