NuGetGallery.FunctionalTests.CommandlineHelper.UpdateNugetExeAsync C# (CSharp) Method

UpdateNugetExeAsync() public method

Self update on nuget.exe
public UpdateNugetExeAsync ( ) : Task
return Task
        public async Task<ProcessResult> UpdateNugetExeAsync()
        {
            var arguments = new List<string>
            {
                UpdateCommandString, SelfSwitch
            };
            return await InvokeNugetProcess(arguments);

        }

Usage Example

 private static async Task EnsureNuGetExeExistsAsync()
 {
     if (!File.Exists("nuget.exe"))
     {
         var nugetExeAddress = "https://nuget.org/nuget.exe";
         using (var webClient = new WebClient())
         {
             webClient.DownloadFileAsync(new Uri(nugetExeAddress), "nuget.exe");
         }
     }
     else
     {
         var commandlineHelper = new CommandlineHelper(ConsoleTestOutputHelper.New);
         await commandlineHelper.UpdateNugetExeAsync();
     }
 }
All Usage Examples Of NuGetGallery.FunctionalTests.CommandlineHelper::UpdateNugetExeAsync