private static async Task ProcessPolicyFilesAsync(PolicyOptions options)
        {
            var path = await InitOutputDirAsync(options);

            await ProcessPolicyFileAsync(PolicyResources.TrustFrameworkBase, options, path, "01-TrustFrameworkBase.xml");
            await ProcessPolicyFileAsync(PolicyResources.TrustFrameworkExtensions, options, path, "02-TrustFrameworkExtensions.xml");
            await ProcessPolicyFileAsync(PolicyResources.SignUpOrSignin, options, path, "03-SignUpOrSignin.xml");
            await ProcessPolicyFileAsync(PolicyResources.PasswordReset, options, path, "04-PasswordReset.xml");
            await ProcessPolicyFileAsync(PolicyResources.ProfileEdit, options, path, "05-ProfileEdit.xml");
        }
        private static async Task ProcessPolicyFileAsync(string content, PolicyOptions options, string outputPath, string fileName)
        {
            content = content
                      .Replace("{{yourtenant}}", options.Tenant)
                      .Replace("{{IdentityExperienceFrameworkAppId}}", options.IdentityExperienceFrameworkAppId)
                      .Replace("{{ProxyIdentityExperienceFrameworkAppId}}", options.ProxyIdentityExperienceFrameworkAppId)
                      .Replace("{{TokenSigningKeyContainerName}}", options.TokenSigningKeyContainer)
                      .Replace("{{TokenEncryptionKeyContainerName}}", options.TokenEncryptionKeyContainer)
                      .Replace("{{ClaimsApiUrl}}", options.ClaimsApiUrl)
            ;

            await File.WriteAllTextAsync(Path.Combine(outputPath, fileName), content);
        }
        private static async Task <string> InitOutputDirAsync(PolicyOptions options)
        {
            var output = Path.Combine(Directory.GetCurrentDirectory(), options.Environment ?? "");

            if (!Directory.Exists(output))
            {
                Directory.CreateDirectory(output);
            }

            var list = new List <string>();

            foreach (var file in Directory.GetFiles(output))
            {
                list.Add(file);
            }

            foreach (var file in list)
            {
                File.Delete(file);
            }

            return(output);
        }