GetFormRegistery() public static méthode

public static GetFormRegistery ( string key ) : string
key string
Résultat string
Exemple #1
0
        private async Task <bool> RunScript(string path)
        {
            PowerShellInstance = PowerShell.Create();

            PowerShellInstance.AddScript(LoadScript(path));

            PowerShellInstance.AddArgument(CredentialHelper.GetFormRegistery(CredentialHelper.SourceRepoUserName));
            PowerShellInstance.AddArgument(CredentialHelper.GetFormRegistery(CredentialHelper.SourceRepoPassword));
            PowerShellInstance.AddArgument(CredentialHelper.GetFormRegistery(CredentialHelper.TargetRepoUserName));
            PowerShellInstance.AddArgument(CredentialHelper.GetFormRegistery(CredentialHelper.TargetRepoPassword));

            PSDataCollection <PSObject> outputCollection = new PSDataCollection <PSObject>();

            outputCollection.DataAdded += outputCollection_DataAdded;

            PowerShellInstance.Streams.Error.DataAdded += Error_DataAdded;

            IAsyncResult result = PowerShellInstance.BeginInvoke <PSObject, PSObject>(null, outputCollection);

            while (result.IsCompleted == false)
            {
                await Task.Delay(100);
            }
            return(PowerShellInstance.HadErrors);
        }
Exemple #2
0
 private void CredentialForm_Load(object sender, EventArgs e)
 {
     SourceRepoUserName.Text = CredentialHelper.GetFormRegistery(CredentialHelper.SourceRepoUserName);
     SourceRepoPassword.Text = CredentialHelper.GetFormRegistery(CredentialHelper.SourceRepoPassword);
     TargetRepoUserName.Text = CredentialHelper.GetFormRegistery(CredentialHelper.TargetRepoUserName);
     TargetRepoPassword.Text = CredentialHelper.GetFormRegistery(CredentialHelper.TargetRepoPassword);
 }
Exemple #3
0
        private static string GetScriptName()
        {
            string script;
            SHA1   sha = new SHA1CryptoServiceProvider();

            using (var stream = File.OpenRead(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile))
            {
                var hash = BitConverter.ToString(sha.ComputeHash(stream));

                if (hash == CredentialHelper.GetFormRegistery("ConfigHash"))
                {
                    script = "UpdateSource.ps1";
                }
                else
                {
                    CredentialHelper.SaveInRegistery("ConfigHash", hash);
                    script = "CheckoutSource.ps1";
                }
            }
            return(script);
        }