/// <summary>
        /// Load list of files in SharePoint folder and then downloads each file to 'Files' folder nex to the exe.
        /// Example of first argument: folder/another subfolder/and so on
        /// </summary>
        /// <param name="args">List relative URL to the folder</param>
        /// <returns>Task</returns>
        static async Task Main(string[] args)
        {
            if (!IsConfigAndArgumentsValid(args))
            {
                Console.WriteLine("Missing argument with folder URL or configuration values in app settings.");
                Console.WriteLine("Press any key to continue...");
                Console.ReadKey();
                return;
            }

            string folder = args[0];

            using (ClientContext client = await AuthenticationUtilities.GetClientContextAsync(Config.SiteUrl))
                using (SecureString password = new SecureString())
                {
                    Console.WriteLine("Connecting to SharePoint site...");
                    client.Load(client.Web, w => w.ServerRelativeUrl);
                    await client.ExecuteQueryAsync();

                    Console.WriteLine("Loading files list...");
                    var files = await GetFilesFromFolderAsync(client, folder);

                    Console.WriteLine($"Loaded {files.Count()} files");
                    IO.Directory.CreateDirectory("Files");

                    foreach (SPFileInfo fileInfo in files)
                    {
                        Console.Write($"Downloading file '{fileInfo.FileName}' ... ");
                        using (IO.Stream stream = await DownloadFileAsync(client, fileInfo.ServerRelativeUrl))
                            using (IO.FileStream file = IO.File.Create($@"Files\{fileInfo.FileName}"))
                            {
                                await stream.CopyToAsync(file);

                                Console.WriteLine("OK");
                            }
                    }
                }

            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
        }