. $("$libFolder\Azure\CommonMsgConstants.ps1")

# App config path have to be set before loading System.Web.dll
#$appConfigPath = "$libFolder\Azure\membership.config"
$providerName = "SqlProvider"

# [System.AppDomain]::CurrentDomain.SetData("APP_CONFIG_FILE", $appConfigPath )
[void][System.Reflection.Assembly]::LoadWithPartialName("System.Web")

# $flag1 = [System.Reflection.BindingFlags]::Instance;
#$flag2 = [System.Reflection.BindingFlags]::NonPublic;
#$flag3 = $flag1 -bor $flag2;
#$connectionStrings = [System.Configuration.ConfigurationManager]::ConnectionStrings;
#$typeInfo = $connectionStrings.GetType();
#$fieldInfo = $typeInfo.BaseType.GetField("bReadOnly", $flag3);
#$fieldInfo.SetValue($connectionStrings, $false);
#$azureConnectionString = New-Object -TypeName "System.Configuration.ConnectionStringSettings" -ArgumentList "AzureMembershipProvider","Data Source=azuesql.gpi-test.parking.ru,1433;Initial Catalog=Microsoft.MgmtSvc.PortalConfigStore;Integrated Security=SSPI;"
#$connectionStrings.Add($azureConnectionString);
#
#$provider = New-Object -TypeName "System.Web.Security.SqlMembershipProvider"
#$nvc = New-Object -TypeName System.Collections.Specialized.NameValueCollection
#$nvc.Add("connectionStringName", $providerName)
#$nvc.Add("enablePasswordRetrieval", "false")
#$nvc.Add("enablePasswordReset", "true")
#$nvc.Add("requiresQuestionAndAnswer", "false")
#$nvc.Add("requiresUniqueEmail", "false")
#$nvc.Add("passwordFormat", "Hashed")
#$nvc.Add("maxInvalidPasswordAttempts", "5")
#$nvc.Add("minRequiredPasswordLength", "6")
#$nvc.Add("minRequiredNonalphanumericCharacters", "0")
#$nvc.Add("passwordAttemptWindow", "10")
#$nvc.Add("passwordStrengthRegularExpression", "")
#$nvc.Add("applicationName", "/")
#$provider.Initialize( $providerName, $nvc );